tzfile (5)
NAME
tzfile - timezone informationDESCRIPTION
The timezone information files used by tzset(3) are typically found under a directory with a name like /usr/share/zoneinfo. These files begin with a 44-byte header containing the following fields:- *
- The magic four-byte ASCII sequence “TZif” identifies the file as a timezone information file.
- *
- A byte identifying the version of the file's format (as of 2017, either an ASCII NUL, or “2”, or “3”).
- *
- Fifteen bytes containing zeros reserved for future use.
- *
- Six four-byte integer values written in a standard byte order (the high-order byte of the value is written first). These values are, in order:
- tzh_ttisgmtcnt
- The number of UT/local indicators stored in the file.
- tzh_ttisstdcnt
- The number of standard/wall indicators stored in the file.
- tzh_leapcnt
- The number of leap seconds for which data entries are stored in the file.
- tzh_timecnt
- The number of transition times for which data entries are stored in the file.
- tzh_typecnt
- The number of local time types for which data entries are stored in the file (must not be zero).
- tzh_charcnt
- The number of bytes of time zone abbreviation strings stored in the file.
- *
- tzh_timecnt four-byte signed integer values sorted in ascending order. These values are written in standard byte order. Each is used as a transition time (as returned by time(2)) at which the rules for computing local time change.
- *
- tzh_timecnt one-byte unsigned integer values; each one but the last tells which of the different types of local time types described in the file is associated with the time period starting with the same-indexed transition time and continuing up to but not including the next transition time. (The last time type is present only for consistency checking with the POSIX-style TZ string described below.) These values serve as indices into the next field.
- *
- tzh_typecnt ttinfo entries, each defined as follows:
struct ttinfo { int32_t tt_gmtoff; unsigned char tt_isdst; unsigned char tt_abbrind; };
- *
- tzh_leapcnt pairs of four-byte values, written in standard byte order; the first value of each pair gives the nonnegative time (as returned by time(2)) at which a leap second occurs; the second gives the total number of leap seconds to be applied during the time period starting at the given time. The pairs of values are sorted in ascending order by time. Each transition is for one leap second, either positive or negative; transitions always separated by at least 28 days minus 1 second.
- *
- tzh_ttisstdcnt standard/wall indicators, each stored as a one-byte value; they tell whether the transition times associated with local time types were specified as standard time or wall clock time, and are used when a timezone file is used in handling POSIX-style timezone environment variables.
- *
- tzh_ttisgmtcnt UT/local indicators, each stored as a one-byte value; they tell whether the transition times associated with local time types were specified as UT or local time, and are used when a timezone file is used in handling POSIX-style timezone environment variables.