Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Arthur David Olson of the National Cancer Institute. | |
6 | .\" modification, are permitted provided that the following conditions | |
7 | .\" are met: | |
8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
15 | .\" notice, this list of conditions and the following disclaimer in the | |
16 | .\" documentation and/or other materials provided with the distribution. | |
17 | .\" 3. All advertising materials mentioning features or use of this software | |
18 | .\" must display the following acknowledgement: | |
19 | .\" This product includes software developed by the University of | |
20 | .\" California, Berkeley and its contributors. | |
21 | .\" 4. Neither the name of the University nor the names of its contributors | |
22 | .\" may be used to endorse or promote products derived from this software | |
23 | .\" without specific prior written permission. | |
24 | .\" | |
25 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
26 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
27 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
28 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
29 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
30 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
31 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
32 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
33 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
34 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
35 | .\" SUCH DAMAGE. | |
36 | .\" | |
37 | .\" @(#)tzfile.5 5.3 (Berkeley) 5/10/91 | |
38 | .\" | |
39 | .Dd May 10, 1991 | |
40 | .Dt TZFILE 5 | |
41 | .Sh NAME | |
42 | .Nm tzfile | |
43 | .Nd time zone information | |
44 | .Sh SYNOPSIS | |
45 | .Fd #include <tzfile.h> | |
46 | .Sh DESCRIPTION | |
47 | The time zone information files used by | |
48 | .Xr tzset 3 | |
49 | begin with bytes reserved for future use, | |
50 | followed by four four-byte values of type | |
51 | .Em long , | |
52 | written in a ``standard'' byte order | |
53 | (the high-order byte of the value is written first). | |
54 | These values are, | |
55 | in order: | |
56 | .Bl -tag -width tzh_ttisstdcnt | |
57 | .It Fa tzh_ttisstdcnt | |
58 | The number of standard/wall indicators stored in the file. | |
59 | .It Fa tzh_leapcnt | |
60 | The number of leap seconds for which data is stored in the file. | |
61 | .It Fa tzh_timecnt | |
62 | The number of "transition times" for which data is stored | |
63 | in the file. | |
64 | .It Fa tzh_typecnt | |
65 | The number of "local time types" for which data is stored | |
66 | in the file (must not be zero). | |
67 | .It Fa tzh_charcnt | |
68 | The number of characters of "time zone abbreviation strings" | |
69 | stored in the file. | |
70 | .El | |
71 | .Pp | |
72 | The above header is followed by | |
73 | .Fa tzh_timecnt | |
74 | four-byte values of type | |
75 | .Em long , | |
76 | sorted in ascending order. | |
77 | These values are written in ``standard'' byte order. | |
78 | Each is used as a transition time (as returned by | |
79 | .Xr time 2 ) | |
80 | at which the rules for computing local time change. | |
81 | Next come | |
82 | .Fa tzh_timecnt | |
83 | one-byte values of type | |
84 | .Fa unsigned char ; | |
85 | each one tells which of the different types of ``local time'' types | |
86 | described in the file is associated with the same-indexed transition time. | |
87 | These values serve as indices into an array of | |
88 | .Fa ttinfo | |
89 | structures that appears next in the file; | |
90 | these structures are defined as follows: | |
91 | .Bd -literal -offset indent | |
92 | struct ttinfo { | |
93 | long tt_gmtoff; | |
94 | int tt_isdst; | |
95 | unsigned int tt_abbrind; | |
96 | }; | |
97 | .Ed | |
98 | .Pp | |
99 | Each structure is written as a four-byte value for | |
100 | .Fa tt_gmtoff | |
101 | of type | |
102 | .Em long , | |
103 | in a standard byte order, followed by a one-byte value for | |
104 | .Fa tt_isdst | |
105 | and a one-byte value for | |
106 | .Fa tt_abbrind . | |
107 | In each structure, | |
108 | .Fa tt_gmtoff | |
109 | gives the number of seconds to be added to GMT, | |
110 | .Fa tt_isdst | |
111 | tells whether | |
112 | .Fa tm_isdst | |
113 | should be set by | |
114 | .Xr localtime 3 | |
115 | and | |
116 | .Fa tt_abbrind | |
117 | serves as an index into the array of time zone abbreviation characters | |
118 | that follow the | |
119 | .Fa ttinfo | |
120 | structure(s) in the file. | |
121 | .Pp | |
122 | Then there are | |
123 | .Fa tzh_leapcnt | |
124 | pairs of four-byte values, written in standard byte order; | |
125 | the first value of each pair gives the time | |
126 | (as returned by | |
127 | .Xr time 2 ) | |
128 | at which a leap second occurs; | |
129 | the second gives the | |
130 | .Em total | |
131 | number of leap seconds to be applied after the given time. | |
132 | The pairs of values are sorted in ascending order by time. | |
133 | .Pp | |
134 | Finally there are | |
135 | .Fa tzh_ttisstdcnt | |
136 | standard/wall indicators, each stored as a one-byte value; | |
137 | they tell whether the transition times associated with local time types | |
138 | were specified as standard time or wall clock time, | |
139 | and are used when a time zone file is used in handling | |
140 | .Tn POSIX Ns -style | |
141 | time zone environment variables. | |
142 | .Pp | |
143 | .Fa Localtime | |
144 | uses the first standard-time | |
145 | .Fa ttinfo | |
146 | structure in the file | |
147 | (or simply the first | |
148 | .Fa ttinfo | |
149 | structure in the absence of a standard-time structure) | |
150 | if either | |
151 | .Fa tzh_timecnt | |
152 | is zero or the time argument is less than the first transition time recorded | |
153 | in the file. | |
154 | .Sh SEE ALSO | |
155 | .Xr ctime 3 | |
156 | .Sh HISTORY | |
157 | The | |
158 | .Nm tzfile | |
159 | file format appeared in | |
160 | .Bx 4.3 tahoe. |