3.1.7 branch.
[minix.git] / man / man5 / tzfile.5
blobceb6a77b31d90792a386784f9e9c8b83a1e8963d
1 .TH TZFILE 5
2 .SH NAME
3 tzfile \- time zone information
4 .SH SYNOPSIS
5 .B
6 #include <tzfile.h>
7 .SH DESCRIPTION
8 The time zone information files used by
9 .IR tzset (3)
10 begin with the magic characters "TZif" to identify then as
11 time zone information files,
12 followed by sixteen bytes reserved for future use,
13 followed by six four-byte values of type
14 .BR long ,
15 written in a ``standard'' byte order
16 (the high-order byte of the value is written first).
17 These values are,
18 in order:
19 .TP
20 .I tzh_ttisgmtcnt
21 The number of UTC/local indicators stored in the file.
22 .TP
23 .I tzh_ttisstdcnt
24 The number of standard/wall indicators stored in the file.
25 .TP
26 .I tzh_leapcnt
27 The number of leap seconds for which data is stored in the file.
28 .TP
29 .I tzh_timecnt
30 The number of "transition times" for which data is stored
31 in the file.
32 .TP
33 .I tzh_typecnt
34 The number of "local time types" for which data is stored
35 in the file (must not be zero).
36 .TP
37 .I tzh_charcnt
38 The number of characters of "time zone abbreviation strings"
39 stored in the file.
40 .PP
41 The above header is followed by
42 .I tzh_timecnt
43 four-byte values of type
44 .BR long ,
45 sorted in ascending order.
46 These values are written in ``standard'' byte order.
47 Each is used as a transition time (as returned by
48 .IR time (2))
49 at which the rules for computing local time change.
50 Next come
51 .I tzh_timecnt
52 one-byte values of type
53 .BR "unsigned char" ;
54 each one tells which of the different types of ``local time'' types
55 described in the file is associated with the same-indexed transition time.
56 These values serve as indices into an array of
57 .I ttinfo
58 structures that appears next in the file;
59 these structures are defined as follows:
60 .in +.5i
61 .sp
62 .nf
63 .ta .5i +\w'unsigned int\0\0'u
64 struct ttinfo {
65         long    tt_gmtoff;
66         int     tt_isdst;
67         unsigned int    tt_abbrind;
69 .in -.5i
70 .fi
71 .sp
72 Each structure is written as a four-byte value for
73 .I tt_gmtoff
74 of type
75 .BR long ,
76 in a standard byte order, followed by a one-byte value for
77 .I tt_isdst
78 and a one-byte value for
79 .IR tt_abbrind .
80 In each structure,
81 .I tt_gmtoff
82 gives the number of seconds to be added to UTC,
83 .I tt_isdst
84 tells whether
85 .I tm_isdst
86 should be set by
87 .I localtime (3)
88 and
89 .I tt_abbrind
90 serves as an index into the array of time zone abbreviation characters
91 that follow the
92 .I ttinfo
93 structure(s) in the file.
94 .PP
95 Then there are
96 .I tzh_leapcnt
97 pairs of four-byte values, written in standard byte order;
98 the first value of each pair gives the time
99 (as returned by
100 .IR time(2))
101 at which a leap second occurs;
102 the second gives the
103 .I total
104 number of leap seconds to be applied after the given time.
105 The pairs of values are sorted in ascending order by time.
107 Then there are
108 .I tzh_ttisstdcnt
109 standard/wall indicators, each stored as a one-byte value;
110 they tell whether the transition times associated with local time types
111 were specified as standard time or wall clock time,
112 and are used when a time zone file is used in handling POSIX-style
113 time zone environment variables.
115 Finally there are
116 .I tzh_ttisgmtcnt
117 UTC/local indicators, each stored as a one-byte value;
118 they tell whether the transition times associated with local time types
119 were specified as UTC or local time,
120 and are used when a time zone file is used in handling POSIX-style
121 time zone environment variables.
123 .I Localtime
124 uses the first standard-time
125 .I ttinfo
126 structure in the file
127 (or simply the first
128 .I ttinfo
129 structure in the absence of a standard-time structure)
130 if either
131 .I tzh_timecnt
132 is zero or the time argument is less than the first transition time recorded
133 in the file.
134 .SH SEE ALSO
135 newctime(3)
136 .\" @(#)tzfile.5        7.12
137 .\" This file is in the public domain, so clarified as of
138 .\" 1996-06-05 by Arthur David Olson.