1 .\" Copyright (c) 1989, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" This code is derived from software contributed to Berkeley by
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" $FreeBSD: src/lib/libc/gen/tzset.3,v 1.6.2.5 2001/12/14 18:33:51 ru Exp $
39 .Nd initialize time conversion information
52 initializes time conversion information used by the library routine
54 The environment variable
56 specifies how this is done.
60 does not appear in the environment, the best available approximation to
61 local wall clock time, as specified by the
62 .Xr tzfile 5 Ns -format
69 appears in the environment but its value is a null string
72 is used, with the abbreviation
74 and without leap second correction; please see
76 for more about UT, UTC, and leap seconds.
80 appears in the environment and its value begins with a colon
82 the rest of its value is used as a pathname of a
83 .Xr tzfile 5 Ns -format
84 file from which to read the time conversion information.
85 If the first character of the pathname is a slash
88 an absolute pathname; otherwise, it is used as a pathname relative to
89 the system time conversion information directory.
91 If its value does not begin with a colon, it is first used as the pathname
92 of a file (as described above) from which to read the time conversion
94 If that file cannot be read, the value is then interpreted as a direct
95 specification (the format is described below) of the time conversion
100 environment variable does not specify a
101 .Xr tzfile 5 Ns -format
102 file and cannot be interpreted as a direct specification,
109 sets things up so that
111 returns the best available approximation of local wall clock time.
112 .Sh SPECIFICATION FORMAT
115 is used directly as a specification of the time conversion information,
116 it must have the following syntax (spaces inserted for clarity):
117 .Bd -ragged -offset indent
127 .Bl -tag -width std_and_dst -offset indent
128 .It Em std No and Em dst
129 Three or more bytes that are the designation for the standard
137 is missing, then summer time does not apply in this locale.
138 Upper and lowercase letters are explicitly allowed. Any characters
139 except a leading colon
152 Indicates the value one must add to the local time to arrive at
153 Coordinated Universal Time. The
156 .Bd -ragged -offset indent
169 are optional. The hour
171 is required and may be a single digit. The
179 summer time is assumed to be one hour ahead of standard time. One or
180 more digits may be used; the value is always interpreted as a decimal
181 number. The hour must be between zero and 24, and the minutes (and
182 seconds) \(em if present \(em between zero and 59. If preceded by a
184 the time zone shall be east of the Prime Meridian; otherwise it shall be
185 west (which may be indicated by an optional preceding
188 Indicates when to change to and back from summer time. The
191 .Bd -ragged -offset indent
192 .Em date/time,date/time
197 describes when the change from standard to summer time occurs and the
200 describes when the change back happens. Each
202 field describes when, in current local time, the change to the other
204 As an extension to POSIX, daylight saving is assumed to be in effect
205 all year if it begins January 1 at 00:00 and ends December 31 at
206 24:00 plus the difference between daylight saving and standard time,
207 leaving no room for standard time in the calendar.
211 is one of the following:
212 .Bl -tag -width "M.m.n.d"
219 Leap days are not counted; that is, in all years \(em including leap
220 years \(em February 28 is day 59 and March 1 is day 60. It is
221 impossible to explicitly refer to the occasional February 29.
223 The zero-based Julian day
227 Leap days are counted, and it is possible to refer to February 29.
252 which may occur in either the fourth or the fifth week). Week 1 is the
253 first week in which the
255 day occurs. Day zero is Sunday.
260 has the same format as
262 except that POSIX does not allow a leading sign
266 As an extension to POSIX, the hours part of
268 can range from -167 through 167; this allows for unusual rules such
270 .Dq the Saturday before the first Sunday of March .
277 Here are some examples of
279 values that directly specify the time zone rules; they use some of the
281 .Bl -tag -width ".Sy EST5X"
283 stands for US Eastern Standard
284 Time (EST), 5 hours behind UTC, without daylight saving.
285 .It Sy FJT-12FJST,M10.3.1/146,M1.3.4/75
286 stands for Fiji Time (FJT) and Fiji Summer Time (FJST), 12 hours ahead
287 of UTC, springing forward on October's third Monday at
288 146:00 (i.e., 02:00 on the first Sunday on or after October 21), and
289 falling back on January's third Thursday at 75:00 (i.e., 03:00 on the
290 first Sunday on or after January 18).
291 .It Sy IST-2IDT,M3.4.4/26,M10.5.0
292 stands for Israel Standard Time (IST) and Israel Daylight Time (IDT),
293 2 hours ahead of UTC, springing forward on March's fourth
294 Tuesday at 26:00 (i.e., 02:00 on the first Friday on or after March
295 23), and falling back on October's last Sunday at 02:00.
296 .It Sy WART4WARST,J1/0,J365/25
297 stands for Western Argentina Summer Time (WARST), 3 hours behind UTC.
298 There is a dummy fall-back transition on December 31 at 25:00 daylight
299 saving time (i.e., 24:00 standard time, equivalent to January 1 at
300 00:00 standard time), and a simultaneous spring-forward transition on
301 January 1 at 00:00 standard time, so daylight saving time is in effect
302 all year and the initial
305 .It Sy WGT3WGST,M3.5.0/-2,M10.5.0/-1
306 stands for Western Greenland Time (WGT) and Western Greenland Summer
307 Time (WGST), 3 hours behind UTC, where clocks follow the EU rules of
308 springing forward on March's last Sunday at 01:00 UTC (\(mi02:00 local
309 time) and falling back on October's last Sunday at 01:00 UTC
317 specification, the rules specified
319 .Xr tzfile 5 Ns -format
322 in the system time conversion information directory are used, with the
323 standard and summer time offsets from
325 replaced by those specified by
331 For compatibility with System V Release 3.1, a semicolon
333 may be used to separate the
335 from the rest of the specification.
337 .Bl -tag -width /usr/share/zoneinfo/posixrules -compact
338 .It Pa /etc/localtime
340 .It Pa /usr/share/zoneinfo
342 .It Pa /usr/share/zoneinfo/posixrules
346 .It Pa /usr/share/zoneinfo/GMT
353 .Pa /usr/share/zoneinfo/GMT
356 leap seconds are loaded from
357 .Pa /usr/share/zoneinfo/posixrules .
371 functions first appeared in