The GetTimeZoneInformation function retrieves the current time-zone parameters. These parameters control the translations between Coordinated Universal Time (UTC) and local time.
DWORD GetTimeZoneInformation(
LPTIME_ZONE_INFORMATION lpTimeZoneInformation |
// address of time-zone settings |
); |
If the function succeeds, the return value is one of the following values:
Value |
Meaning |
TIME_ZONE_ID_UNKNOWN |
The operating system cannot determine the current time zone. This is usually because a previous call to the SetTimeZoneInformation function supplied only the bias (and no transition dates). Windows NT: This value is also returned if daylight savings time is not used in the current time zone (StandardBias equals DaylightBias). |
TIME_ZONE_ID_STANDARD |
The operating system is operating in the range covered by the StandardDate member of the TIME_ZONE_INFORMATION structure. Windows 95: This value is also returned if daylight savings time is not used in the current time zone (StandardBias equals DaylightBias). |
TIME_ZONE_ID_DAYLIGHT |
The operating system is operating in the range covered by the DaylightDate member of the TIME_ZONE_INFORMATION structure. |
If the function fails, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError.
All translations between UTC time and local time are based on the following formula:
UTC = local time + bias
The bias is the difference, in minutes, between UTC time and local time.