X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b1e0606aa2cb3b8bd13f8b03c5a796c3972b732..4378079d848c8a4cf2a9032b284e077add1d55ff:/src/common/timercmn.cpp diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index b2ba8d0538..8a34f3cfda 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -36,7 +36,7 @@ #include "wx/timer.h" // I'm told VMS is POSIX, so should have localtime() -#if defined(__WXMSW__) || defined(__VMS__) || defined(__WXPM__) +#if defined(__WXMSW__) || defined(__VMS__) || defined(__WXPM__) || defined(__WXMAC__) // configure might have found it already for us #ifndef HAVE_LOCALTIME #define HAVE_LOCALTIME @@ -46,7 +46,7 @@ // TODO: #define WX_GMTOFF_IN_TM for Windows compilers which have it here #if defined(__WIN32__) && !defined(WX_GMTOFF_IN_TM) - #include + #include #endif #if defined(HAVE_GETTIMEOFDAY) @@ -136,6 +136,12 @@ long wxGetCurrentTime() // return GMT time in millisecond long wxGetCurrentMTime() { +#if defined(__WIN32__) + SYSTEMTIME st; + ::GetLocalTime(&st); + + return 1000*(60*(60*st.wHour+st.wMinute)+st.wSecond)+st.wMilliseconds; +#else #if defined(HAVE_LOCALTIME) time_t t0 = time(&t0); if ( t0 != (time_t)-1 ) @@ -166,6 +172,7 @@ long wxGetCurrentMTime() wxLogSysError(_("Failed to get the system time")); return -1; +#endif // __WIN32__/!__WIN32__ } bool wxGetLocalTime(long *timeZone, int *dstObserved)