tznamecontains two strings, which are the standard names of the pair of time zones (standard and daylight saving) that the user has selected.
tznameis the name of the standard time zone (for example,
tznameis the name for the time zone when daylight saving time is in use (for example,
"EDT"). These correspond to the std and dst strings (respectively) from the
TZenvironment variable. If daylight saving time is never used,
tznameis the empty string.
tzname array is initialized from the
localtime is called. If multiple abbreviations
have been used (e.g.
"EDT" for U.S. Eastern War
Time and Eastern Daylight Time), the array contains the most recent
tzname array is required for POSIX.1 compatibility, but in
GNU programs it is better to use the
tm_zone member of the
broken-down time structure, since
tm_zone reports the correct
abbreviation even when it is not the latest one.
tzsetfunction initializes the
tznamevariable from the value of the
TZenvironment variable. It is not usually necessary for your program to call this function, because it is called automatically when you use the other time conversion functions that depend on the time zone.
The following variables are defined for compatibility with System V
tzname, these variables are set by calling
tzset or the other time conversion functions.
5*60*60. Unlike the
tm_gmtoffmember of the broken-down time structure, this value is not adjusted for daylight saving, and its sign is reversed. In GNU programs it is better to use
tm_gmtoff, since it contains the correct offset even when it is not the latest one.
Go to the first, previous, next, last section, table of contents.