]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix time zone in wxDateTime::UNow().
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 20 Jan 2012 22:11:55 +0000 (22:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 20 Jan 2012 22:11:55 +0000 (22:11 +0000)
The internal wxDateTime representation is in the UTC, so use
wxGetUTCTimeMillis() in UNow(), using wxGetLocalTimeMillis() made it
inconsistent with Now() and wrong.

Really closes #13862.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/datetime.cpp

index e3370e520fb44bee396763c6fa749902cbdab846..236c2c93efd3f17d61689eb6c437c6c795476590 100644 (file)
@@ -453,6 +453,7 @@ All:
 - Added wxLogFormatter to allow customizing wxLog output (Sébastien Gallou).
 - Added "%z" support to wxDateTime::Format() and Parse() (Armel Asselin).
 - Add wxHTTP::SetPostBuffer(wxMemoryBuffer) and SetPostText() (Eran Ifrah).
+- Fix wrong time zone used in wxDateTime::UNow().
 
 All (GUI):
 
index 90038a27c3b601fe16d9e26f5e24370f3d8e1dcc..b70f3331fb152481eabe0d654a328c80502948b6 100644 (file)
@@ -1102,7 +1102,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country)
 // return the current time with ms precision
 /* static */ wxDateTime wxDateTime::UNow()
 {
-    return wxDateTime(wxGetLocalTimeMillis());
+    return wxDateTime(wxGetUTCTimeMillis());
 }
 
 // the values in the tm structure contain the local time