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.
tzset
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The tzset function uses the current setting of the environment
variable TZ to assign values to three global variables: daylight,
timezone, and tzname. These variables are used by the ftime and
localtime functions to make corrections from Greenwich mean time
(GMT) to local time, and by the time function to compute GMT from
system time.
The value of the environment variable TZ must be a three-letter
time-zone name, such as PST, followed by an optionally signed
number giving the difference in hours between GMT and local time.
The number can be followed by a three-letter daylight-saving-time
(DST) zone, such as PDT. For example, "PST8PDT" represents a valid
TZ value for the Pacific time zone. If DST is never in effect, as
is the case in certain states and localities, TZ should be set
without a DST zone.
If TZ is not currently set, the default is PST8PDT, which
corresponds to the Pacific time zone.
Based on the TZ environment variable, 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
The default for daylight is 1; for timezone, 28800; for tzname[0],
PST; and for tzname[1], PDT. This corresponds to PST8PDT.
If the DST zone is omitted from the TZ settings, the daylight
variable will be 0 and the ftime, gmtime, and localtime functions
will return 0 for their DST flags.
Return Value
None.
-♦-