Microsoft KB Archive/68383

= TZ and tzset Only Use Whole Hours: How to Work Around =

Q68383

-

The information in this article applies to:


 * Microsoft C for MS-DOS, versions 5.1, 6.0, 6.0a, and 6.0ax
 * Microsoft C for OS/2, versions 5.1, 6.0, and 6.0a
 * Microsoft Visual C++, versions 1.0, 1.5, 2.0, 2.1

-

In Microsoft C versions 5.1, 6.0, 6.0a, and 6.0ax, the TZ environment variable and the tzset function can use only whole hours for time zone adjustments. These functions cannot be used, for example, to calculate the time in Sri Lanka, which is 330 minutes off of GMT.

The only workaround in C 6.x is to use a second environment variable (for example, TZ2) to add thirty minutes to the times passed by functions that return and use local times.

Beginning with C/C++ version 7.0, tzset and TZ have been enhanced to accept TZ values of the form tzn[+|-]hh[:mm[:ss]][dzn]. Additional query words: kbinf 6.00 6.00a 6.00ax 1.00 1.50 2.00 2.10

Keywords : kbCRT kbVC

Issue type :

Technology : kbVCsearch kbAudDeveloper kbvc150 kbvc100 kbVC200 kbVC210

Last Reviewed: July 22, 2001

-

[mailto:MSDN@MICROSOFT.COM Send feedback to Microsoft]

© 2002 Microsoft Corporation. All rights reserved.