Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GetTimeZoneInformationForYear function

Retrieves the time zone settings for the specified year and time zone. These settings control the translations between Coordinated Universal Time (UTC) and local time.


BOOL WINAPI GetTimeZoneInformationForYear(
  _In_     USHORT                         wYear,
  _Out_    LPTIME_ZONE_INFORMATION        ptzi


wYear [in]

The year for which the time zone settings are to be retrieved. The wYear parameter must be a local time value.

pdtzi [in, optional]

A pointer to a DYNAMIC_TIME_ZONE_INFORMATION structure that specifies the time zone. To populate this parameter, call EnumDynamicTimeZoneInformation with the index of the time zone you want. If this parameter is NULL, the current time zone is used.

ptzi [out]

A pointer to a TIME_ZONE_INFORMATION structure that receives the time zone settings.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


The wYear parameter is assumed to be a local time value. If the local time is close to the transition between the old year and the new year (00:00:00 January 1), passing a UTC year to the GetTimeZoneInformationForYear function can cause the function to return time zone settings for the wrong year.

The StandardName and DaylightName members of the resultant TIME_ZONE_INFORMATION structure are localized according to the current user default UI language.


Minimum supported client

Windows Vista with SP1 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 [desktop apps | UWP apps]

Minimum supported phone

Windows Phone 8


Winbase.h (include Windows.h)





See also

Local Time
Time Functions



© 2017 Microsoft