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