]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
VC6 compilation fix for native wxProgressDialog implementation.
[wxWidgets.git] / src / common / datetime.cpp
index 3f036e61da28be80f9e2164701ad362ecfb2d5ee..d6e965cb094aef87a2b604802d182e38186388b1 100644 (file)
@@ -281,8 +281,6 @@ static const int SEC_PER_MIN = 60;
 
 static const int MIN_PER_HOUR = 60;
 
-static const int HOURS_PER_DAY = 24;
-
 static const long SECONDS_PER_DAY = 86400l;
 
 static const int DAYS_PER_WEEK = 7;
@@ -2349,6 +2347,14 @@ wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
             st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
 }
 
+wxDateTime& wxDateTime::SetFromMSWSysDate(const SYSTEMTIME& st)
+{
+    return Set(st.wDay,
+            static_cast<wxDateTime::Month>(wxDateTime::Jan + st.wMonth - 1),
+            st.wYear,
+            0, 0, 0, 0);
+}
+
 void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
 {
     const wxDateTime::Tm tm(GetTm());
@@ -2363,6 +2369,22 @@ void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
     st->wSecond = tm.sec;
     st->wMilliseconds = tm.msec;
 }
+
+void wxDateTime::GetAsMSWSysDate(SYSTEMTIME* st) const
+{
+    const wxDateTime::Tm tm(GetTm());
+
+    st->wYear = (WXWORD)tm.year;
+    st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
+    st->wDay = tm.mday;
+
+    st->wDayOfWeek =
+    st->wHour =
+    st->wMinute =
+    st->wSecond =
+    st->wMilliseconds = 0;
+}
+
 #endif // __WXMSW__
 
 #endif // wxUSE_DATETIME