3 tzset \- initialize time conversion information
6 .ie \n(.g .ds - \f(CW-\fP
10 .B timezone_t tzalloc(char const *TZ);
12 .B void tzfree(timezone_t tz);
21 .ie '\(lq'' .ds lq \&"\"
23 .ie '\(rq'' .ds rq \&"\"
26 \\$3\*(lq\\$1\*(rq\\$2
29 allocates and returns a time zone object described by
33 is not a valid time zone description, or if the object cannot be allocated,
35 returns a null pointer and sets
39 frees a time zone object
41 which should have been successfully allocated by
51 .BR tzalloc(getenv("TZ")) ,
52 except it saves any resulting time zone object into internal
53 storage that is accessed by
58 The anonymous shared time zone object is freed by the next call to
60 If the implied call to
68 is null, the best available approximation to local wall
69 clock time, as specified by the
73 in the system time conversion information directory, is used.
77 Universal Time (UT) is used, with the abbreviation "UTC"
78 and without leap second correction; please see
80 for more about UT, UTC, and leap seconds. If
82 is nonnull and nonempty:
84 if the value begins with a colon, it is used as a pathname of a file
85 from which to read the time conversion information;
87 if the value does not begin with a colon, it is first used as the
88 pathname of a file from which to read the time conversion information,
89 and, if that file cannot be read, is used directly as a specification of
90 the time conversion information.
94 is used as a pathname, if it begins with a slash,
95 it is used as an absolute pathname; otherwise,
96 it is used as a pathname relative to a system time conversion information
98 The file must be in the format specified in
103 is used directly as a specification of the time conversion information,
104 it must have the following syntax (spaces inserted for clarity):
106 \fIstd\|offset\fR[\fIdst\fR[\fIoffset\fR][\fB,\fIrule\fR]]
112 Three or more bytes that are the designation for the standard
120 is missing, then summer time does not apply in this locale.
121 Upper- and lowercase letters are explicitly allowed. Any characters
122 except a leading colon
130 and NUL bytes are allowed.
131 Alternatively, a designation can be surrounded by angle brackets
135 in this case, the designation can contain any characters other than
140 Indicates the value one must add to the local time to arrive at
141 Coordinated Universal Time. The
146 \fIhh\fR[\fB:\fImm\fR[\fB:\fIss\fR]]
153 are optional. The hour
155 is required and may be a single digit. The
163 summer time is assumed to be one hour ahead of standard time. One or
164 more digits may be used; the value is always interpreted as a decimal
165 number. The hour must be between zero and 24, and the minutes (and
166 seconds) \*(en if present \*(en between zero and 59. If preceded by a
168 the time zone shall be east of the Prime Meridian; otherwise it shall be
169 west (which may be indicated by an optional preceding
173 Indicates when to change to and back from summer time. The
178 \fIdate\fB/\fItime\fB,\fIdate\fB/\fItime\fR
183 describes when the change from standard to summer time occurs and the
186 describes when the change back happens. Each
188 field describes when, in current local time, the change to the other
190 As an extension to POSIX, daylight saving is assumed to be in effect
191 all year if it begins January 1 at 00:00 and ends December 31 at
192 24:00 plus the difference between daylight saving and standard time,
193 leaving no room for standard time in the calendar.
197 is one of the following:
203 .RI "(1\ \(<=" "\ n\ " "\(<=\ 365).
204 Leap days are not counted; that is, in all years \*(en including leap
205 years \*(en February 28 is day 59 and March 1 is day 60. It is
206 impossible to explicitly refer to the occasional February 29.
209 The zero-based Julian day
210 .RI "(0\ \(<=" "\ n\ " "\(<=\ 365).
211 Leap days are counted, and it is possible to refer to February 29.
217 .RI "(0\ \(<=" "\ d\ " "\(<=\ 6)
223 .RI "(1\ \(<=" "\ n\ " "\(<=\ 5,
224 .RI "1\ \(<=" "\ m\ " "\(<=\ 12,
226 .q "the last \fId\fP day in month \fIm\fP"
227 which may occur in either the fourth or the fifth week). Week 1 is the
228 first week in which the
230 day occurs. Day zero is Sunday.
235 has the same format as
237 except that POSIX does not allow a leading sign (\c
241 As an extension to POSIX, the hours part of
243 can range from \-167 through 167; this allows for unusual rules such
245 .q "the Saturday before the first Sunday of March" .
252 Here are some examples of
254 values that directly specify the time zone rules; they use some of the
258 stands for US Eastern Standard
259 Time (EST), 5 hours behind UTC, without daylight saving.
261 .B FJT\*-12FJST,M11.1.0,M1.3.4/75
262 stands for Fiji Time (FJT) and Fiji Summer Time (FJST), 12 hours ahead
263 of UTC, springing forward on November's first Sunday at 02:00, and
264 falling back on January's third Thursday at 75:00 (i.e., 03:00 on the
265 first Sunday on or after January 18).
267 .B IST\*-2IDT,M3.4.4/26,M10.5.0
268 stands for Israel Standard Time (IST) and Israel Daylight Time (IDT),
269 2 hours ahead of UTC, springing forward on March's fourth
270 Thursday at 26:00 (i.e., 02:00 on the first Friday on or after March
271 23), and falling back on October's last Sunday at 02:00.
273 .B WART4WARST,J1/0,J365/25
274 stands for Western Argentina Summer Time (WARST), 3 hours behind UTC.
275 There is a dummy fall-back transition on December 31 at 25:00 daylight
276 saving time (i.e., 24:00 standard time, equivalent to January 1 at
277 00:00 standard time), and a simultaneous spring-forward transition on
278 January 1 at 00:00 standard time, so daylight saving time is in effect
279 all year and the initial
283 .B WGT3WGST,M3.5.0/\*-2,M10.5.0/\*-1
284 stands for Western Greenland Time (WGT) and Western Greenland Summer
285 Time (WGST), 3 hours behind UTC, where clocks follow the EU rules of
286 springing forward on March's last Sunday at 01:00 UTC (\-02:00 local
287 time) and falling back on October's last Sunday at 01:00 UTC
288 (\-01:00 local time).
296 .IR tzfile (5)-format
299 in the system time conversion information directory are used, with the
300 standard and summer time offsets from UTC replaced by those specified by
306 For compatibility with System V Release 3.1, a semicolon
308 may be used to separate the
310 from the rest of the specification.
312 .ta \w'/usr/local/etc/zoneinfo/posixrules\0\0'u
313 /usr/local/etc/zoneinfo time zone information directory
315 /usr/local/etc/zoneinfo/localtime local time zone file
317 /usr/local/etc/zoneinfo/posixrules used with POSIX-style TZ's
319 /usr/local/etc/zoneinfo/GMT for UTC leap seconds
322 .B /usr/local/etc/zoneinfo/GMT
324 UTC leap seconds are loaded from
325 .BR /usr/local/etc/zoneinfo/posixrules .
332 .\" This file is in the public domain, so clarified as of
333 .\" 2009-05-17 by Arthur David Olson.