Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Retrieves the current time zone settings. These settings control the translations between Coordinated Universal Time (UTC) and local time.
To support boundaries for daylight saving time that change from year to year, use the GetDynamicTimeZoneInformation or GetTimeZoneInformationForYear function.
DWORD GetTimeZoneInformation(
[out] LPTIME_ZONE_INFORMATION lpTimeZoneInformation
);
[out] lpTimeZoneInformation
A pointer to a TIME_ZONE_INFORMATION structure to receive the current settings.
If the function succeeds, it returns one of the following values.
Return code/value | Description |
---|---|
|
Daylight saving time is not used in the current time zone, because there are no transition dates or automatic adjustment for daylight saving time is disabled. |
|
The system is operating in the range covered by the StandardDate member of the TIME_ZONE_INFORMATION structure. |
|
The system is operating in the range covered by the DaylightDate member of the TIME_ZONE_INFORMATION structure. |
If the function fails for other reasons, such as an out of memory error, it returns TIME_ZONE_ID_INVALID. 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.
The StandardName and DaylightName members of the resultant TIME_ZONE_INFORMATION structure are localized according to the current user default UI language.
For an example, see SetTimeZoneInformation.
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps | UWP apps] |
Minimum supported server | Windows 2000 Server [desktop apps | UWP apps] |
Target Platform | Windows |
Header | timezoneapi.h (include Windows.h) |
Library | Kernel32.lib |
DLL | Kernel32.dll |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today