SystemTimeToTzSpecificLocalTime

 

Description

 

Converts a time in Coordinated Universal Time (UTC) to a specified time zone's corresponding local time.

 

C++ Syntax

 

BOOL WINAPI SystemTimeToTzSpecificLocalTime(

__in_opt LPTIME_ZONE_INFORMATION lpTimeZone,

__in     LPSYSTEMTIME lpUniversalTime,

__out    LPSYSTEMTIME lpLocalTime

);

 

PowerBASIC Syntax

 

FUNCTION SystemTimeToTzSpecificLocalTime ( _

BYREF lpTimeZone AS TIME_ZONE_INFORMATION, _

BYREF lpUniversalTime AS SYSTEMTIME, _

BYREF lpLocalTime AS SYSTEMTIME _

) AS LONG

 

Parameters

 

lpTimeZone

 

[in, optional] A pointer to a TIME_ZONE_INFORMATION structure that specifies the time zone of interest.

 

If lpTimeZone is NULL, the function uses the currently active time zone.

 

lpUniversalTime

 

[in] A pointer to a SYSTEMTIME structure that specifies a time, in UTC. The function converts this universal time to the specified time zone's corresponding local time.

 

lpLocalTime

 

[out] A pointer to a SYSTEMTIME structure that receives the local time.

 

Return Value

 

If the function succeeds, the return value is nonzero, and the function sets the members of the SYSTEMTIME structure pointed to by lpLocalTime to the appropriate local time values.

 

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

 

Remarks

 

The SystemTimeToTzSpecificLocalTime function takes into account whether the time to be converted falls in daylight saving time or not.

 

The SystemTimeToTzSpecificLocalTime function may calculate the local time incorrectly under the following conditions:

 

The time zone uses a different UTC offset for the old and new years.
The UTC time to be converted and the calculated local time are in different years.

 

Valid XHTML 1.0 Transitional