2 out of 3 rated this helpful - Rate this topic

GetTimeZoneInformationForYear function

Applies to: desktop apps | Metro style apps

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.

Requirements

Minimum supported client

Windows Vista with SP1

Minimum supported server

Windows Server 2008

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

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ