]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
Correct names of some event binders
[wxWidgets.git] / src / common / log.cpp
index c4d3ef212b5744023f02a31066af368d2bf0f397..c59af3cb3ff40461df363cfdb0b5f75ed4b365e4 100644 (file)
@@ -37,6 +37,7 @@
 #endif //WX_PRECOMP
 
 #include "wx/apptrait.h"
+#include "wx/datetime.h"
 #include "wx/file.h"
 #include "wx/msgout.h"
 #include "wx/textfile.h"
@@ -411,16 +412,21 @@ void wxLog::ClearTraceMasks()
 
 void wxLog::TimeStamp(wxString *str)
 {
+#if wxUSE_DATETIME
     if ( ms_timestamp )
     {
         wxChar buf[256];
         time_t timeNow;
         (void)time(&timeNow);
-        wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow));
+
+        struct tm tm;
+        wxStrftime(buf, WXSIZEOF(buf),
+                    ms_timestamp, wxLocaltime_r(&timeNow, &tm));
 
         str->Empty();
         *str << buf << wxT(": ");
     }
+#endif // wxUSE_DATETIME
 }
 
 void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)