]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
Ensure that strings returned by wxMBConv_cf are in NFC form.
[wxWidgets.git] / src / common / datetime.cpp
index eecee09de4bf42f9a70cd2997aabbb82cbc66a03..2a26b7b1213c7e51535f551678a7cdc0f5e6f4b1 100644 (file)
@@ -137,30 +137,16 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter<wxDateTime> , wxFromStringCon
         #define WX_TIMEZONE wxGetTimeZone()
     #elif defined(__DARWIN__)
         #define WX_GMTOFF_IN_TM
-    #elif defined(__WXWINCE__) && defined(__VISUALC8__)
-        // _timezone is not present in dynamic run-time library
-        #if 0
-        // Solution (1): use the function equivalent of _timezone
+    #elif wxCHECK_VISUALC_VERSION(8)
+        // While _timezone is still present in (some versions of) VC CRT, it's
+        // deprecated and _get_timezone() should be used instead.
         static long wxGetTimeZone()
         {
             long t;
-            _get_timezone(& t);
+            _get_timezone(&t);
             return t;
         }
         #define WX_TIMEZONE wxGetTimeZone()
-        #elif 1
-        // Solution (2): using GetTimeZoneInformation
-        static long wxGetTimeZone()
-        {
-            TIME_ZONE_INFORMATION tzi;
-            ::GetTimeZoneInformation(&tzi);
-            return tzi.Bias; // x 60
-        }
-        #define WX_TIMEZONE wxGetTimeZone()
-        #else
-        // Old method using _timezone: this symbol doesn't exist in the dynamic run-time library (i.e. using /MD)
-        #define WX_TIMEZONE _timezone
-        #endif
     #else // unknown platform - try timezone
         #define WX_TIMEZONE timezone
     #endif
@@ -1616,6 +1602,7 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
     // construct Tm from these values
     Tm tm;
     tm.year = (int)year;
+    tm.yday = (wxDateTime_t)(dayOfYear - 1); // use C convention for day number
     tm.mon = (Month)(month - 1); // algorithm yields 1 for January, not 0
     tm.mday = (wxDateTime_t)day;
     tm.msec = (wxDateTime_t)(timeOnly % 1000);