-namespace {
-
-using Msp::Time::TimeZone;
-
-TimeZone get_local_timezone()
-{
-#ifdef WIN32
- TIME_ZONE_INFORMATION tzinfo;
- DWORD dst=GetTimeZoneInformation(&tzinfo);
- if(dst==TIME_ZONE_ID_INVALID)
- throw SystemError("Failed to get time zone information", GetLastError());
-
- int offset=tzinfo.Bias;
- if(dst==TIME_ZONE_ID_STANDARD)
- offset+=tzinfo.StandardBias;
- else if(dst==TIME_ZONE_ID_DAYLIGHT)
- offset+=tzinfo.DaylightBias;
-
- return TimeZone(offset);
-#else
- tzset();
- return TimeZone(timezone/60);
-#endif
-}
-
-}
-