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