次の方法で共有


_daylight, _timezone, and _tzname

_daylight, _timezone, and _tzname are used in some time and date routines to make local-time adjustments. They are declared in TIME.H as

extern int _daylight;

extern long _timezone;

extern char *_tzname[2];

On a call to _ftime, localtime, or _tzset, the values of _daylight, _timezone, and _tzname are determined from the value of the TZ environment variable. If you do not explicitly set the value of TZ, _tzname[0] and _tzname[1] contain empty strings, but the time-manipulation functions (_tzset, _ftime, and localtime) attempt to set the values of _daylight and _timezone by querying the operating system for the default value of each variable. The time-zone global variable values are as follows.

Variable Value
_daylight Nonzero if daylight-saving-time zone (DST) is specified in TZ; otherwise, 0. Default value is 1.
_timezone Difference in seconds between coordinated universal time and local time. Default value is 28,800.
_tzname[0] Time-zone name derived from TZ environment variable.
_tzname[1] DST zone name derived from TZ environment variable. Default value is PDT (Pacific daylight time). If DST zone is omitted from TZ, _tzname[1] is empty string.