C Language and Libraries Help (clang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_daylight, _timezone, _tzname
◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
─────Run-Time Library───────────────────────────────────────────────────────
Variable: _daylight, _timezone, _tzname
Include: <time.h>
Context: _tzset
Syntax: int _daylight;
long _timezone;
char *_tzname[2];
The _daylight, _timezone, and _tzname variables are used by
several of the time and date functions to make local-time
adjustments. They are declared in the include file TIME.H. The
values of the variables are determined by the setting of an
environment variable named TZ.
The following values are assigned to the _daylight, _timezone,
and _tzname variables when _tzset is called:
Variable Value
_daylight Nonzero value if a daylight-saving-time zone is
specified in the TZ setting; otherwise, 0
_timezone The difference in seconds between GMT and local time
_tzname[0] The string value of the three-letter time-zone name
from the TZ setting
_tzname[1] The string value of the daylight-saving-time zone,
or an empty string if the daylight-saving-time zone
is omitted from the TZ setting
When you call the _ftime or localtime function, the values of
these three variables are determined from the TZ setting. The
_daylight variable is given a nonzero value if a DST zone is
present in the TZ setting; otherwise, _daylight is 0.
The _timezone variable is assigned the difference in seconds
(calculated by converting the hours given in the TZ setting)
between Universal Coordinated Time and local time. The first
element of the _tzname variable is the string value of the
three-letter time zone from the TZ setting; the second element
is the string value of the DST zone. If the DST zone is omitted
from the TZ setting, _tzname[1] is an empty string.
The _ftime and localtime functions call another function, _tzset,
to assign values to the three global variables from the TZ
setting. You can also call _tzset directly if you like.
See: _tzset
-♦-