2 #include <msp/core/systemerror.h>
8 TimeZone TimeZone::platform_get_local_timezone()
10 TIME_ZONE_INFORMATION tzinfo;
11 DWORD dst = GetTimeZoneInformation(&tzinfo);
12 if(dst==TIME_ZONE_ID_INVALID)
13 throw Msp::system_error("GetTimeZoneInformation");
15 int offset = tzinfo.Bias;
16 if(dst==TIME_ZONE_ID_STANDARD)
17 offset += tzinfo.StandardBias;
18 else if(dst==TIME_ZONE_ID_DAYLIGHT)
19 offset += tzinfo.DaylightBias;
21 return TimeZone(offset);