Re: wxDateTime and date validation

PB <[email protected]> Wed, 30 Apr 2025 05:53:57 -0700 (PDT)
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Ooops, I had a typo in the code in my previous post, using ParseDate() 
instead of ParseISODate(). 

The conclusion still stands though, full corrected code:
        const wxString isoDateSrcStr("2020-01-01");
        wxDateTime dt;

        if ( dt.ParseISODate(isoDateSrcStr) )
        {
            wxString isoDateDstStr = dt.FormatISODate();

            if ( isoDateDstStr == isoDateSrcStr )
                wxLogMessage("ISO date roundtrip successful: %s", 
isoDateDstStr);
            else
                wxLogError("ISO date roundtrip unsuccessful: %s vs %s", 
isoDateSrcStr, isoDateDstStr);
        }
        else
            wxLogError("Could not parse ISO date %s", isoDateSrcStr);

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/be6d1131-8fe5-4649-832d-7c9946012832n%40googlegroups.com.