Allow using milliseconds in wxLog timestamp.

Use wxDateTime::UNow() instead of time() and wxDateTime::Format() instead of
localtime() to make it possible to use "%l" specifier in wxLog time stamp.

Closes #13059.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-03-21 10:59:59 +00:00
parent ab4387390c
commit 019044877a
2 changed files with 3 additions and 10 deletions

View File

@ -451,6 +451,7 @@ All:
- Added wxStack<> template class.
- Added precision parameter to wxString::From[C]Double().
- Added wxThread::Wait() and Delete() "wait mode" parameter (Catalin Raceanu).
- Allow showing milliseconds in wxLog time stamps (tan).
Unix:

View File

@ -676,16 +676,8 @@ void wxLog::TimeStamp(wxString *str)
#if wxUSE_DATETIME
if ( !ms_timestamp.empty() )
{
wxChar buf[256];
time_t timeNow;
(void)time(&timeNow);
struct tm tm;
wxStrftime(buf, WXSIZEOF(buf),
ms_timestamp, wxLocaltime_r(&timeNow, &tm));
str->Empty();
*str << buf << wxS(": ");
*str = wxDateTime::UNow().Format(ms_timestamp);
*str += wxS(": ");
}
#endif // wxUSE_DATETIME
}