git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59673
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
case _T('c'): // locale default date and time representation
{
wxDateTime dt;
case _T('c'): // locale default date and time representation
{
wxDateTime dt;
const wxString inc(input);
const wxString inc(input);
// to our generic code anyhow
const wxStringCharType *
result = CallStrptime(input, "%c", &tm);
// to our generic code anyhow
const wxStringCharType *
result = CallStrptime(input, "%c", &tm);
+ if ( result )
+ {
+ haveDay = haveMon = haveYear =
+ haveHour = haveMin = haveSec = true;
+
+ hour = tm.tm_hour;
+ min = tm.tm_min;
+ sec = tm.tm_sec;
+
+ year = 1900 + tm.tm_year;
+ mon = (Month)tm.tm_mon;
+ mday = tm.tm_mday;
+
+ input = result; // proceed where strptime() ended
+ }
+ else
{
// strptime() failed; try generic heuristic code
#endif // HAVE_STRPTIME
{
// strptime() failed; try generic heuristic code
#endif // HAVE_STRPTIME
+ Tm tm = dt.GetTm();
+
+ haveDay = haveMon = haveYear =
+ haveHour = haveMin = haveSec = true;
+
+ hour = tm.hour;
+ min = tm.min;
+ sec = tm.sec;
+
+ year = tm.year;
+ mon = tm.mon;
+ mday = tm.mday;
+
input += endc - inc.begin();
#ifdef HAVE_STRPTIME
}
input += endc - inc.begin();
#ifdef HAVE_STRPTIME
}
- else
- input = result; // proceed where strptime() ended
-
- haveDay = haveMon = haveYear =
- haveHour = haveMin = haveSec = true;
-
- hour = tm.hour;
- min = tm.min;
- sec = tm.sec;
-
- year = tm.year;
- mon = tm.mon;
- mday = tm.mday;