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

ID: Q68383


The information in this article applies to:

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 
Version           : 5.10 6.00 6.00a | 1.00 1.50 | 1.
Platform          : MS-DOS NT WINDOWS 
Issue type        : 

Last Reviewed: July 29, 1999