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 .\" @(#)tzset.3 8.2 (Berkeley) 11/17/93
40 .Nd initialize time conversion information
53 initializes time conversion information used by the library routine
55 The environment variable
57 specifies how this is done.
61 does not appear in the environment, the best available approximation to
62 local wall clock time, as specified by the
63 .Xr tzfile 5 Ns -format
70 appears in the environment but its value is a null string, Coordinated
73 is used (without leap second correction).
77 appears in the environment and its value begins with a colon
79 the rest of its value is used as a pathname of a
80 .Xr tzfile 5 Ns -format
81 file from which to read the time conversion information.
82 If the first character of the pathname is a slash
85 an absolute pathname; otherwise, it is used as a pathname relative to
86 the system time conversion information directory.
88 If its value does not begin with a colon, it is first used as the pathname
89 of a file (as described above) from which to read the time conversion
91 If that file cannot be read, the value is then interpreted as a direct
92 specification (the format is described below) of the time conversion
97 environment variable does not specify a
98 .Xr tzfile 5 Ns -format
99 file and cannot be interpreted as a direct specification,
106 sets things up so that
108 returns the best available approximation of local wall clock time.
109 .Sh SPECIFICATION FORMAT
112 is used directly as a specification of the time conversion information,
113 it must have the following syntax (spaces inserted for clarity):
114 .Bd -ragged -offset indent
124 .Bl -tag -width std_and_dst -offset indent
125 .It Em std No and Em dst
126 Three or more bytes that are the designation for the standard
135 is missing, then summer time does not apply in this locale.
136 Upper and lowercase letters are explicitly allowed.
138 except a leading colon
151 Indicates the value one must add to the local time to arrive at
152 Coordinated Universal Time.
156 .Bd -ragged -offset indent
172 is required and may be a single digit.
182 summer time is assumed to be one hour ahead of standard time.
184 more digits may be used; the value is always interpreted as a decimal
186 The hour must be between zero and 24, and the minutes (and
187 seconds) \(em if present \(em between zero and 59.
190 the time zone shall be east of the Prime Meridian; otherwise it shall be
191 west (which may be indicated by an optional preceding
194 Indicates when to change to and back from summer time.
198 .Bd -ragged -offset indent
199 .Em date/time,date/time
204 describes when the change from standard to summer time occurs and the
207 describes when the change back happens.
210 field describes when, in current local time, the change to the other
215 is one of the following:
216 .Bl -tag -width "M.m.n.d"
223 Leap days are not counted; that is, in all years \(em including leap
224 years \(em February 28 is day 59 and March 1 is day 60.
226 impossible to explicitly refer to the occasional February 29.
228 The zero-based Julian day
232 Leap days are counted, and it is possible to refer to February 29.
257 which may occur in either the fourth or the fifth week).
259 first week in which the
266 has the same format as
268 except that no leading sign
283 specification, the rules specified
285 .Xr tzfile 5 Ns -format
288 in the system time conversion information directory are used, with the
289 standard and summer time offsets from
291 replaced by those specified by
298 For compatibility with System V Release 3.1, a semicolon
300 may be used to separate the
302 from the rest of the specification.
304 .Bl -tag -width /usr/share/zoneinfo/posixrules -compact
305 .It Pa /etc/localtime
307 .It Pa /usr/share/zoneinfo
309 .It Pa /usr/share/zoneinfo/posixrules
313 .It Pa /usr/share/zoneinfo/Etc/GMT
320 .Pa /usr/share/zoneinfo/UTC
323 leap seconds are loaded from
324 .Pa /usr/share/zoneinfo/posixrules .
337 functions first appeared in