git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60847
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#endif
// we have to use our own implementation if the date is out of range of
// strftime() or if we use non standard specificators
#endif
// we have to use our own implementation if the date is out of range of
// strftime() or if we use non standard specificators
time_t time = GetTicks();
if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) )
time_t time = GetTicks();
if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) )
}
}
//else: use generic code below
}
}
//else: use generic code below
+#endif // wxHAS_STRFTIME
// we only parse ANSI C format specifications here, no POSIX 2
// complications, no GNU extensions but we do add support for a "%l" format
// we only parse ANSI C format specifications here, no POSIX 2
// complications, no GNU extensions but we do add support for a "%l" format
case _T('c'): // locale default date and time representation
case _T('x'): // locale default date representation
case _T('c'): // locale default date and time representation
case _T('x'): // locale default date representation
//
// the problem: there is no way to know what do these format
// specifications correspond to for the current locale.
//
// the problem: there is no way to know what do these format
// specifications correspond to for the current locale.
+#else // !wxHAS_STRFTIME
// Use "%m/%d/%y %H:%M:%S" format instead
res += wxString::Format(wxT("%02d/%02d/%04d %02d:%02d:%02d"),
tm.mon+1,tm.mday, tm.year, tm.hour, tm.min, tm.sec);
// Use "%m/%d/%y %H:%M:%S" format instead
res += wxString::Format(wxT("%02d/%02d/%04d %02d:%02d:%02d"),
tm.mon+1,tm.mday, tm.year, tm.hour, tm.min, tm.sec);
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
break;
case _T('d'): // day of a month (01-31)
break;
case _T('d'): // day of a month (01-31)
break;
case _T('p'): // AM or PM string
break;
case _T('p'): // AM or PM string
res += CallStrftime(_T("%p"), &tmTimeOnly);
res += CallStrftime(_T("%p"), &tmTimeOnly);
+#else // !wxHAS_STRFTIME
res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am");
res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am");
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
break;
case _T('S'): // second as a decimal number (00-61)
break;
case _T('S'): // second as a decimal number (00-61)
case _T('X'): // locale default time representation
// just use strftime() to format the time for us
case _T('X'): // locale default time representation
// just use strftime() to format the time for us
res += CallStrftime(_T("%X"), &tmTimeOnly);
res += CallStrftime(_T("%X"), &tmTimeOnly);
+#else // !wxHAS_STRFTIME
res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec);
res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec);
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
break;
case _T('y'): // year without century (00-99)
break;
case _T('y'): // year without century (00-99)
break;
case _T('Z'): // timezone name
break;
case _T('Z'): // timezone name
res += CallStrftime(_T("%Z"), &tmTimeOnly);
#endif
break;
res += CallStrftime(_T("%Z"), &tmTimeOnly);
#endif
break;