diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index af922ee6fe..b2bd5cc287 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -147,40 +147,26 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter , wxFromStringCon #if !defined(WX_TIMEZONE) && !defined(WX_GMTOFF_IN_TM) #if defined(__WXPALMOS__) #define WX_GMTOFF_IN_TM - #elif defined(__BORLANDC__) || defined(__MINGW32__) || defined(__VISAGECPP__) + #elif defined(__WXMSW__) + static long wxGetTimeZone() + { + static long s_timezone = MAXLONG; // invalid timezone + if (s_timezone == MAXLONG) + { + TIME_ZONE_INFORMATION info; + GetTimeZoneInformation(&info); + s_timezone = info.Bias * 60; // convert minutes to seconds + } + return s_timezone; + } + #define WX_TIMEZONE wxGetTimeZone() + #elif defined(__VISAGECPP__) #define WX_TIMEZONE _timezone #elif defined(__MWERKS__) long wxmw_timezone = 28800; #define WX_TIMEZONE wxmw_timezone - #elif defined(__DJGPP__) || defined(__WINE__) - #include - #include - static long wxGetTimeZone() - { - static long timezone = MAXLONG; // invalid timezone - if (timezone == MAXLONG) - { - struct timeb tb; - ftime(&tb); - timezone = tb.timezone; - } - return timezone; - } - #define WX_TIMEZONE wxGetTimeZone() #elif defined(__DARWIN__) #define WX_GMTOFF_IN_TM - #elif defined(__VISUALC8__) - // _timezone is not present in VC8 static run-time library but - // _get_timezone() is so just use it for all builds - static long wxGetTimeZone() - { - static long s_timezone = LONG_MAX; // invalid timezone - if ( s_timezone == LONG_MAX ) - _get_timezone(&s_timezone); - - return s_timezone; - } - #define WX_TIMEZONE wxGetTimeZone() #else // unknown platform - try timezone #define WX_TIMEZONE timezone #endif