Export (0) Print
Expand All
2 out of 3 rated this helpful - Rate this topic

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.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

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

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

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

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.