]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
Another place we need an autorelease pool.
[wxWidgets.git] / src / common / datetime.cpp
index 1547b4a14e14bc0c957be8820626b8e0a9f14531..2474382dba6d6190fe7b136e852d065d84d0b767 100644 (file)
@@ -3186,13 +3186,15 @@ wxDateTime::ParseFormat(const wxString& date,
          haveYear = false,
          haveHour = false,
          haveMin = false,
-         haveSec = false;
+         haveSec = false,
+         haveMsec = false;
 
     bool hourIsIn12hFormat = false, // or in 24h one?
          isPM = false;              // AM by default
 
     // and the value of the items we have (init them to get rid of warnings)
-    wxDateTime_t sec = 0,
+    wxDateTime_t msec = 0,
+                 sec = 0,
                  min = 0,
                  hour = 0;
     WeekDay wday = Inv_WeekDay;
@@ -3376,6 +3378,14 @@ wxDateTime::ParseFormat(const wxString& date,
                 yday = (wxDateTime_t)num;
                 break;
 
+            case _T('l'):       // milliseconds (0-999)
+                if ( !GetNumericToken(width, input, &num) )
+                    return NULL;
+
+                haveMsec = true;
+                msec = (wxDateTime_t)num;
+                break;
+
             case _T('m'):       // month as a number (01-12)
                 if ( !GetNumericToken(width, input, &num) || !num || (num > 12) )
                 {
@@ -3757,6 +3767,9 @@ wxDateTime::ParseFormat(const wxString& date,
         tm.sec = sec;
     }
 
+    if ( haveMsec )
+        tm.msec = msec;
+
     Set(tm);
 
     // finally check that the week day is consistent -- if we had it