// allows to exclude the usage of wxDateTime
static wxString TimeStamp(const wxChar *format, time_t t)
{
+#if wxUSE_DATETIME
wxChar buf[4096];
- if ( !wxStrftime(buf, WXSIZEOF(buf), format, localtime(&t)) )
+ struct tm tm;
+ if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) )
{
// buffer is too small?
wxFAIL_MSG(_T("strftime() failed"));
}
return wxString(buf);
+#else // !wxUSE_DATETIME
+ return wxEmptyString;
+#endif // wxUSE_DATETIME/!wxUSE_DATETIME
}