]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
added wxRTTI macros to stream classes (patch 1687073)
[wxWidgets.git] / src / common / datetime.cpp
index c40dedee2b2842d14dac35edec5add9f1af31f26..f69eeb9e92fa3545fa5872b604c27cab70f943f8 100644 (file)
@@ -660,7 +660,7 @@ void wxDateTime::Tm::ComputeWeekDay()
     // compute the week day from day/month/year: we use the dumbest algorithm
     // possible: just compute our JDN and then use the (simple to derive)
     // formula: weekday = (JDN + 1.5) % 7
     // compute the week day from day/month/year: we use the dumbest algorithm
     // possible: just compute our JDN and then use the (simple to derive)
     // formula: weekday = (JDN + 1.5) % 7
-    wday = (wxDateTime::wxDateTime_t)((wxDateTime::WeekDay)(GetTruncatedJDN(mday, mon, year) + 2) % 7);
+    wday = (wxDateTime::wxDateTime_t)((GetTruncatedJDN(mday, mon, year) + 2) % 7);
 }
 
 void wxDateTime::Tm::AddMonths(int monDiff)
 }
 
 void wxDateTime::Tm::AddMonths(int monDiff)
@@ -2261,11 +2261,11 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
 {
     wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxDateTime::Format") );
 
 {
     wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxDateTime::Format") );
 
-    time_t time = GetTicks();
-
     // we have to use our own implementation if the date is out of range of
     // strftime() or if we use non standard specificators
 #ifdef HAVE_STRFTIME
     // we have to use our own implementation if the date is out of range of
     // strftime() or if we use non standard specificators
 #ifdef HAVE_STRFTIME
+    time_t time = GetTicks();
+
     if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) )
     {
         // use strftime()
     if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) )
     {
         // use strftime()