]> git.saurik.com Git - wxWidgets.git/commitdiff
Take time into account in wxDateTime <-> SYSTEMTIME conversion.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 6 Sep 2009 14:31:01 +0000 (14:31 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 6 Sep 2009 14:31:01 +0000 (14:31 +0000)
wxDateTime::SetFromMSWSysTime() and GetAsMSWSysTime() worked with the date
part of SYSTEMTIME only, do use time part as well now.

Closes #11176.

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

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

index ad36dd94bbee439454ed524f851cc5096250363e..4e78622771087086298b9e31809f1e34618cca9c 100644 (file)
@@ -412,6 +412,7 @@ MSW:
 - Fix wxMDIChildFrame::SetSize() (Lars Rosenboom).
 - Fix wxTreeCtrl::UnselectItem() in single selection controls.
 - Allow customizing wxStandardPaths logic for program directory determination.
+- Use time in wxDateTime <-> SYSTEMTIME conversion (troelsk).
 
 i18n:
 
index 2adec8c242846d5da92cc88f9553b97b53df5016..677a3b6fb8b1d506aed18e41b0fbe5c0fa05f41f 100644 (file)
@@ -2356,7 +2356,7 @@ wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
     return Set(st.wDay,
             static_cast<wxDateTime::Month>(wxDateTime::Jan + st.wMonth - 1),
             st.wYear,
-            0, 0, 0);
+            st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
 }
 
 void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
@@ -2367,11 +2367,11 @@ void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
     st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
     st->wDay = tm.mday;
 
-    st->wDayOfWeek =
-    st->wHour =
-    st->wMinute =
-    st->wSecond =
-    st->wMilliseconds = 0;
+    st->wDayOfWeek = 0;
+    st->wHour = tm.hour;
+    st->wMinute = tm.min;
+    st->wSecond = tm.sec;
+    st->wMilliseconds = tm.msec;
 }
 #endif // __WXMSW__