Re: wxDateTime and date validation

PB <[email protected]> Wed, 30 Apr 2025 05:41:45 -0700 (PDT)
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Hi,

I can confirm this works as expected with wxWidgets 3.2.8 and GIT Master on 
Windows, tested with
 const wxString isoDateSrcStr("2020-01-01");
 wxDateTime dt;

 if ( dt.ParseDate(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);

I have also checked whether it matters if the datetime was valid (had 
value) before parsing: It does not.

Best,
PB 

-- 
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/838d1b0e-b885-49dd-a126-3dc534fb0ea3n%40googlegroups.com.