Sweep over our manual pages and remove .Pp before a .Bd or .Bl without
[dragonfly.git] / lib / libc / stdtime / tzfile.5
1 .\" $FreeBSD: src/lib/libc/stdtime/tzfile.5,v 1.8.2.2 2001/08/17 15:42:43 ru Exp $
2 .\" $DragonFly: src/lib/libc/stdtime/tzfile.5,v 1.3 2008/05/02 02:05:04 swildner Exp $
3 .Dd September 13, 1994
4 .Dt TZFILE 5
5 .Os
6 .Sh NAME
7 .Nm tzfile
8 .Nd timezone information
9 .Sh SYNOPSIS
10 .Fd #include \&"/usr/src/lib/libc/stdtime/tzfile.h\&"
11 .Sh DESCRIPTION
12 The time zone information files used by
13 .Xr tzset 3
14 begin with the magic characters
15 .Dq Li TZif
16 to identify them as
17 time zone information files,
18 followed by sixteen bytes reserved for future use,
19 followed by four four-byte values
20 written in a ``standard'' byte order
21 (the high-order byte of the value is written first).
22 These values are,
23 in order:
24 .Pp
25 .Bl -tag -compact -width tzh_ttisstdcnt
26 .It Va tzh_ttisgmtcnt
27 The number of UTC/local indicators stored in the file.
28 .It Va tzh_ttisstdcnt
29 The number of standard/wall indicators stored in the file.
30 .It Va tzh_leapcnt
31 The number of leap seconds for which data is stored in the file.
32 .It Va tzh_timecnt
33 The number of ``transition times'' for which data is stored
34 in the file.
35 .It Va tzh_typecnt
36 The number of ``local time types'' for which data is stored
37 in the file (must not be zero).
38 .It Va tzh_charcnt
39 The number of characters of ``time zone abbreviation strings''
40 stored in the file.
41 .El
42 .Pp
43 The above header is followed by
44 .Va tzh_timecnt
45 four-byte values of type
46 .Fa long ,
47 sorted in ascending order.
48 These values are written in ``standard'' byte order.
49 Each is used as a transition time (as returned by
50 .Xr time 3 )
51 at which the rules for computing local time change.
52 Next come
53 .Va tzh_timecnt
54 one-byte values of type
55 .Fa "unsigned char" ;
56 each one tells which of the different types of ``local time'' types
57 described in the file is associated with the same-indexed transition time.
58 These values serve as indices into an array of
59 .Fa ttinfo
60 structures that appears next in the file;
61 these structures are defined as follows:
62 .Bd -literal -offset indent
63 struct ttinfo {
64         long    tt_gmtoff;
65         int     tt_isdst;
66         unsigned int    tt_abbrind;
67 };
68 .Ed
69 .Pp
70 Each structure is written as a four-byte value for
71 .Va tt_gmtoff
72 of type
73 .Fa long ,
74 in a standard byte order, followed by a one-byte value for
75 .Va tt_isdst
76 and a one-byte value for
77 .Va tt_abbrind .
78 In each structure,
79 .Va tt_gmtoff
80 gives the number of seconds to be added to UTC,
81 .Li tt_isdst
82 tells whether
83 .Li tm_isdst
84 should be set by
85 .Xr localtime 3
86 and
87 .Va tt_abbrind
88 serves as an index into the array of time zone abbreviation characters
89 that follow the
90 .Li ttinfo
91 structure(s) in the file.
92 .Pp
93 Then there are
94 .Va tzh_leapcnt
95 pairs of four-byte values, written in standard byte order;
96 the first value of each pair gives the time
97 (as returned by
98 .Xr time 3 )
99 at which a leap second occurs;
100 the second gives the
101 .Em total
102 number of leap seconds to be applied after the given time.
103 The pairs of values are sorted in ascending order by time.
104 .Pp
105 Then there are
106 .Va tzh_ttisstdcnt
107 standard/wall indicators, each stored as a one-byte value;
108 they tell whether the transition times associated with local time types
109 were specified as standard time or wall clock time,
110 and are used when a time zone file is used in handling POSIX-style
111 time zone environment variables.
112 .Pp
113 Finally there are
114 .Va tzh_ttisgmtcnt
115 UTC/local indicators, each stored as a one-byte value;
116 they tell whether the transition times associated with local time types
117 were specified as UTC or local time,
118 and are used when a time zone file is used in handling POSIX-style
119 time zone environment variables.
120 .Pp
121 .Nm localtime
122 uses the first standard-time
123 .Li ttinfo
124 structure in the file
125 (or simply the first
126 .Li ttinfo
127 structure in the absence of a standard-time structure)
128 if either
129 .Li tzh_timecnt
130 is zero or the time argument is less than the first transition time recorded
131 in the file.
132 .Sh SEE ALSO
133 .Xr ctime 3 ,
134 .Xr time2posix 3 ,
135 .Xr zic 8
136 .\" @(#)tzfile.5        7.2
137 .\" This file is in the public domain, so clarified as of
138 .\" 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).