Microsoft KB Archive/235955

{|
 * width="100%"|

BUG: SetTimeZoneInformation May Alter the System Time

 * }

Q235955

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0

-

SYMPTOMS
The SetTimeZoneInformation function sets the current time-zone parameters. These parameters control translations from Coordinated Universal Time (UTC) to the local time.

If the time-zone parameters are configured for a time zone that does not observe daylight saving time, a call to SetTimeZoneInformation sets the time-zone parameters, but it may also change the system time.

NOTE: This bug occurs only if the time zone selected at startup time does not observe daylight saving time.

RESOLUTION
The following algorithm can be used to work around this problem:


 * 1) Obtain the current system time by calling GetSystemTime.
 * 2) Issue a call to SetTimeZoneInformation and specify the time zone you want to set.
 * 3) Call GetSystemTime again to determine whether the system time has been altered. If the system time has been altered, set it back to the original time using SetSystemTime.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION
Additional query words:

Keywords : kbAPI kbDateTime kbKernBase kbOSWinNT400 kbSDKPlatform kbSDKWin32 kbDSupport kbGrpDSKernBase

Issue type : kbbug

Technology : kbAudDeveloper kbWin32sSearch kbWin32API