1 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
2 .\" This file is in the public domain, so clarified as of
3 .\" 1996-06-05 by Arthur David Olson <arthur_david_olson@nih.gov>.
8 .TH TZFILE 5 2015-05-07 "" "Linux Programmer's Manual"
10 tzfile \- timezone information
12 This page describes the structure of the timezone files used by
14 These files are typically found under one of the directories
17 .IR /usr/share/zoneinfo .
19 Timezone information files begin with a 44-byte header structured as follows:
21 The magic four-byte sequence
22 "TZif" identifying this as a
23 timezone information file.
25 A single character identifying the version of the file's format:
26 either an ASCII NUL (\(aq\\0\(aq) or a \(aq2\(aq (\fB0x32\fP).
28 Fifteen bytes containing zeros reserved for future use.
30 Six four-byte values of type
32 written in a "standard" byte order
33 (the high-order byte of the value is written first).
39 The number of UTC/local indicators stored in the file.
42 The number of standard/wall indicators stored in the file.
45 The number of leap seconds for which data is stored in the file.
48 The number of "transition times" for which data is stored
52 The number of "local time types" for which data is stored
53 in the file (must not be zero).
56 The number of characters of "timezone abbreviation strings"
60 The above header is followed by
62 four-byte values of type
64 sorted in ascending order.
65 These values are written in "standard" byte order.
66 Each is used as a transition time (as returned by
68 at which the rules for computing local time change.
71 one-byte values of type
73 each one tells which of the different types of "local time" types
74 described in the file is associated with the same-indexed transition time.
75 These values serve as indices into an array of
79 entries) that appear next in the file;
80 these structures are defined as follows:
87 unsigned int tt_abbrind;
92 Each structure is written as a four-byte value for
96 in a standard byte order, followed by a one-byte value for
98 and a one-byte value for
102 gives the number of seconds to be added to UTC,
110 serves as an index into the array of timezone abbreviation characters
113 structure(s) in the file.
117 pairs of four-byte values, written in standard byte order;
118 the first value of each pair gives the time
121 at which a leap second occurs;
124 number of leap seconds to be applied after the given time.
125 The pairs of values are sorted in ascending order by time.
129 standard/wall indicators, each stored as a one-byte value;
130 they tell whether the transition times associated with local time types
131 were specified as standard time or wall clock time,
132 and are used when a timezone file is used in handling POSIX-style
133 timezone environment variables.
137 UTC/local indicators, each stored as a one-byte value;
138 they tell whether the transition times associated with local time types
139 were specified as UTC or local time,
140 and are used when a timezone file is used in handling POSIX-style
141 timezone environment variables.
144 uses the first standard-time
146 structure in the file
149 structure in the absence of a standard-time structure)
152 is zero or the time argument is less than the first transition time recorded
155 For version-2-format timezone files,
156 the above header and data is followed by a second header and data,
157 identical in format except that
158 eight bytes are used for each transition time or leap-second time
159 (and that the version byte in the header record is
160 \fB0x32\fP rather than \fB0x00\fP).
161 After the second header and data comes a newline-enclosed,
162 POSIX-TZ-environment-variable-style string for use in handling instants
163 after the last transition time stored in the file
164 (with nothing between the newlines if there is no POSIX representation for
167 The second section of the timezone file consists of another 44-byte header
168 record, identical in structure to the one at the beginning of the file,
169 except that it applies to the data that follows,
170 which is also identical in structure
171 to the first section of the timezone file, with the following differences:
173 The transition time values, after the header, are eight-byte values.
175 In each leap second record, the leap second value is an eight-byte value.
176 The accumulated leap second count is still a four-byte value.
178 In all cases, the eight-byte time values are given in
179 the "standard" byte order,
180 the high-order byte first.
181 .SS POSIX timezone string
182 The second eight-byte time value section is followed by an optional
184 a single ASCII newline character (\(aq\\n\(aq),
185 then a text string followed by a second
187 The text string is a POSIX timezone string, whose format is described in the
191 The POSIX timezone string defines a rule for computing transition times
192 that follow the last transition time explicitly specified in the timezone
194 .SS Summary of the timezone information file format
199 Four-byte value section
200 (header version \fB0x00\fP or \fB0x32\fP)
202 Four-byte transition times
203 Transition time index
204 \fBttinfo\fP structures
205 Timezone abbreviation array
210 Eight-byte value section
211 (only if first header version is \fB0x32\fP,
212 the second header's version is also \fB0x32\fP)
214 Eight-byte transition times
215 Transition time index
216 \fBttinfo\fP structures
217 Timezone abbreviation array
223 (optional, only in \fB0x32\fP version files)
236 in the glibc source tree