Windows apps
Collapse the table of content
Expand the table of content
Information
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.

Syntax


BOOL WINAPI GetTimeZoneInformationForYear(
  _In_     USHORT                         wYear,
  _In_opt_ PDYNAMIC_TIME_ZONE_INFORMATION pdtzi,
  _Out_    LPTIME_ZONE_INFORMATION        ptzi
);

Parameters

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. 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.

Remarks

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.

Requirements

Minimum supported client

Windows Vista with SP1 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

DYNAMIC_TIME_ZONE_INFORMATION
Local Time
TIME_ZONE_INFORMATION
Time Functions

 

 

Show:
© 2016 Microsoft