3 tzset - initialize time conversion information
11 Tzset uses the value of the environment variable TZ to set
12 time conversion information used by localtime. If TZ does
13 not appear in the environment, the best available
14 approximation to local wall clock time, as specified by the
15 tzfile(5)-format file localtime in the system time
16 conversion information directory, is used by localtime. If
17 TZ appears in the environment but its value is a null
18 string, Coordinated Universal Time (UTC) is used (without
19 leap second correction). If TZ appears in the environment
20 and its value is not a null string:
22 if the value begins with a colon, it is used as a
23 pathname of a file from which to read the time
24 conversion information;
26 if the value does not begin with a colon, it is first
27 used as the pathname of a file from which to read the
28 time conversion information, and, if that file cannot
29 be read, is used directly as a specification of the
30 time conversion information.
32 When TZ is used as a pathname, if it begins with a slash, it
33 is used as an absolute pathname; otherwise, it is used as a
34 pathname relative to a system time conversion information
35 directory. The file must be in the format specified in
38 When TZ is used directly as a specification of the time
39 conversion information, it must have the following syntax
40 (spaces inserted for clarity):
42 stdoffset[dst[offset][,rule]]
46 std and dst Three or more bytes that are the
47 designation for the standard (std) or
48 summer (dst) time zone. Only std is
49 required; if dst is missing, then summer
50 time does not apply in this locale.
51 Upper- and lowercase letters are
52 explicitly allowed. Any characters
53 except a leading colon (:), digits,
54 comma (,), minus (-), plus (+), and
55 ASCII NUL are allowed.
57 offset Indicates the value one must add to the
58 local time to arrive at Coordinated
59 Universal Time. The offset has the
64 The minutes (mm) and seconds (ss) are
65 optional. The hour (hh) is required and
66 may be a single digit. The offset
67 following std is required. If no offset
68 follows dst, summer time is assumed to
69 be one hour ahead of standard time. One
70 or more digits may be used; the value is
71 always interpreted as a decimal number.
72 The hour must be between zero and 24,
73 and the minutes (and seconds) - if
74 present - between zero and 59. If
75 preceded by a ``-'', the time zone shall
76 be east of the Prime Meridian; otherwise
77 it shall be west (which may be indicated
78 by an optional preceding ``+'').
80 rule Indicates when to change to and back
81 from summer time. The rule has the
86 where the first date describes when the
87 change from standard to summer time
88 occurs and the second date describes
89 when the change back happens. Each time
90 field describes when, in current local
91 time, the change to the other time is
94 The format of date is one of the
98 (1 < n < 365). Leap days are
99 not counted; that is, in all
100 years - including leap years -
101 February 28 is day 59 and
102 March 1 is day 60. It is
103 impossible to explicitly refer
104 to the occasional February 29.
106 n The zero-based Julian day
107 (0 < n < 365). Leap days are
108 counted, and it is possible to
109 refer to February 29.
111 Mm.n.d The d'th day (0 < d < 6) of
112 week n of month m of the year
113 (1 < n < 5, 1 < m < 12, where
114 week 5 means ``the last d day
115 in month m'' which may occur
116 in either the fourth or the
117 fifth week). Week 1 is the
118 first week in which the d'th
119 day occurs. Day zero is
122 The time has the same format as offset
123 except that no leading sign (``-'' or
124 ``+'') is allowed. The default, if time
125 is not given, is 02:00:00.
127 If no rule is present in TZ, the rules specified by the
128 tzfile(5)-format file posixrules in the system time
129 conversion information directory are used, with the standard
130 and summer time offsets from UTC replaced by those specified
131 by the offset values in TZ.
133 For compatibility with System V Release 3.1, a semicolon (;)
134 may be used to separate the rule from the rest of the
137 If the TZ environment variable does not specify a
138 tzfile(5)-format and cannot be interpreted as a direct
139 specification, UTC is used.
142 /usr/local/etc/zoneinfo time zone information
144 /usr/local/etc/zoneinfo/localtime local time zone file
145 /usr/local/etc/zoneinfo/posixrules used with POSIX-style
147 /usr/local/etc/zoneinfo/GMT for UTC leap seconds
149 If /usr/local/etc/zoneinfo/GMT is absent, UTC leap seconds
150 are loaded from /usr/local/etc/zoneinfo/posixrules.
153 getenv(3), newctime(3), newstrftime(3), time(2), tzfile(5)