The information in this article applies to:
SYMPTOMSUnder Windows NT, localtime( time() ) returns the correct local time. However, under Win32s, the local time returned is not correct if the TZ environment variable is set. For example, suppose that you are in the Pacific time zone (GMT-08:00) and have set tz=pst8pdt. The time returned under Win32s is off by 8 hours. CAUSE
This is by design.
RESOLUTIONTo get the current local time under both Win32s and Windows NT, use the following code to clear the tz environment variable and get the time:
Note that _putenv() affects only the tz environment variable for the
application. All other applications use the global environment settings and
make their own modifications.
Additional query words: 1.10 1.20
Keywords : kbWin32s |
Last Reviewed: January 14, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |