// in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to
// indicate an invalid wxDateTime object
-
-static const wxDateTime gs_dtDefault;
-
-const wxDateTime& wxDefaultDateTime = gs_dtDefault;
+const wxDateTime wxDefaultDateTime;
wxDateTime::Country wxDateTime::ms_country = wxDateTime::Country_Unknown;
break;
}
- return !!s && s.ToULong(number);
+ // use the base 10 explicitly because otherwise the string "09" (the
+ // leading zeroes are common in the date specifications) is not parsed
+ // correctly as, according to the standard C rules, it is understood as an
+ // octal number and '9' is not a valid octal digit!
+ return !s.empty() && s.ToULong(number, 10);
}
// scans all alphabetic characters and returns the resulting string
// is it a number?
unsigned long val;
- if ( token.ToULong(&val) )
+ if ( token.ToULong(&val, 10) ) // 10: see comment in GetNumericToken()
{
// guess what this number is