1TZFILE(5) Linux Programmer's Manual TZFILE(5)
2
3
4
6 tzfile - timezone information
7
9 #include <tzfile.h>
10
12 The timezone information files used by tzset(3) begin with the magic
13 characters "TZif" to identify then as timezone information files, fol‐
14 lowed by sixteen bytes reserved for future use, followed by six four-
15 byte values of type long, written in a "standard" byte order (the high-
16 order byte of the value is written first). These values are, in order:
17
18 tzh_ttisgmtcnt
19 The number of UTC/local indicators stored in the file.
20
21 tzh_ttisstdcnt
22 The number of standard/wall indicators stored in the file.
23
24 tzh_leapcnt
25 The number of leap seconds for which data is stored in the file.
26
27 tzh_timecnt
28 The number of "transition times" for which data is stored in the
29 file.
30
31 tzh_typecnt
32 The number of "local time types" for which data is stored in the
33 file (must not be zero).
34
35 tzh_charcnt
36 The number of characters of "timezone abbreviation strings"
37 stored in the file.
38
39 The above header is followed by tzh_timecnt four-byte values of type
40 long, sorted in ascending order. These values are written in "stan‐
41 dard" byte order. Each is used as a transition time (as returned by
42 time(2)) at which the rules for computing local time change. Next come
43 tzh_timecnt one-byte values of type unsigned char; each one tells which
44 of the different types of "local time" types described in the file is
45 associated with the same-indexed transition time. These values serve
46 as indices into an array of ttinfo structures that appears next in the
47 file; these structures are defined as follows:
48
49 struct ttinfo {
50 long tt_gmtoff;
51 int tt_isdst;
52 unsigned int tt_abbrind;
53 };
54
55 Each structure is written as a four-byte value for tt_gmtoff of type
56 long, in a standard byte order, followed by a one-byte value for
57 tt_isdst and a one-byte value for tt_abbrind. In each structure,
58 tt_gmtoff gives the number of seconds to be added to UTC, tt_isdst
59 tells whether tm_isdst should be set by localtime(3), and tt_abbrind
60 serves as an index into the array of timezone abbreviation characters
61 that follow the ttinfo structure(s) in the file.
62
63 Then there are tzh_leapcnt pairs of four-byte values, written in stan‐
64 dard byte order; the first value of each pair gives the time (as
65 returned by time(2)) at which a leap second occurs; the second gives
66 the total number of leap seconds to be applied after the given time.
67 The pairs of values are sorted in ascending order by time.
68
69 Then there are tzh_ttisstdcnt standard/wall indicators, each stored as
70 a one-byte value; they tell whether the transition times associated
71 with local time types were specified as standard time or wall clock
72 time, and are used when a timezone file is used in handling POSIX-style
73 timezone environment variables.
74
75 Finally, there are tzh_ttisgmtcnt UTC/local indicators, each stored as
76 a one-byte value; they tell whether the transition times associated
77 with local time types were specified as UTC or local time, and are used
78 when a timezone file is used in handling POSIX-style timezone environ‐
79 ment variables.
80
81 Localtime uses the first standard-time ttinfo structure in the file (or
82 simply the first ttinfo structure in the absence of a standard-time
83 structure) if either tzh_timecnt is zero or the time argument is less
84 than the first transition time recorded in the file.
85
87 This page is part of release 3.22 of the Linux man-pages project. A
88 description of the project, and information about reporting bugs, can
89 be found at http://www.kernel.org/doc/man-pages/.
90
91
92
93 1996-06-05 TZFILE(5)