Restore badly commented out MAPLOWER/MAPUPPER
[unix-history] / share / zoneinfo / newtzset.3
CommitLineData
1bd76676
GW
1.TH NEWTZSET 3
2.SH NAME
3tzset \- initialize time conversion information
4.SH SYNOPSIS
5.nf
6.B void tzset()
7.PP
8.B cc ... -lz
9.fi
10.SH DESCRIPTION
11.I Tzset
12uses the value of the environment variable
13.B TZ
14to set time conversion information used by
15.IR localtime .
16If
17.B TZ
18does not appear in the environment,
19the best available approximation to local wall clock time, as specified
20by the
21.IR tzfile (5)-format
22file
23.B localtime
24in the system time conversion information directory, is used by
25.IR localtime .
26If
27.B TZ
28appears in the environment but its value is a null string,
29Coordinated Universal Time (UTC) is used (without leap second
30correction). If
31.B TZ
32appears in the environment and its value is not a null string:
33.IP
34if the value begins with a colon, it is used as a pathname of a file
35from which to read the time conversion information;
36.IP
37if the value does not begin with a colon, it is first used as the
38pathname of a file from which to read the time conversion information,
39and, if that file cannot be read, is used directly as a specification of
40the time conversion information.
41.PP
42When
43.B TZ
44is used as a pathname, if it begins with a slash,
45it is used as an absolute pathname; otherwise,
46it is used as a pathname relative to a system time conversion information
47directory.
48The file must be in the format specified in
49.IR tzfile (5).
50.PP
51When
52.B TZ
53is used directly as a specification of the time conversion information,
54it must have the following syntax (spaces inserted for clarity):
55.IP
56\fIstd\|offset\fR[\fIdst\fR[\fIoffset\fR][\fB,\fIrule\fR]]
57.PP
58Where:
59.RS
60.TP 15
61.IR std " and " dst
62Three or more bytes that are the designation for the standard
63.RI ( std )
64or summer
65.RI ( dst )
66time zone. Only
67.I std
68is required; if
69.I dst
70is missing, then summer time does not apply in this locale.
71Upper- and lowercase letters are explicitly allowed. Any characters
72except a leading colon
73.RB ( : ),
74digits, comma
75.RB ( , ),
76minus
77.RB ( \(mi ),
78plus
79.RB ( \(pl ),
80and ASCII NUL are allowed.
81.TP
82.I offset
83Indicates the value one must add to the local time to arrive at
84Coordinated Universal Time. The
85.I offset
86has the form:
87.RS
88.IP
89\fIhh\fR[\fB:\fImm\fR[\fB:\fIss\fR]]
90.RE
91.IP
92The minutes
93.RI ( mm )
94and seconds
95.RI ( ss )
96are optional. The hour
97.RI ( hh )
98is required and may be a single digit. The
99.I offset
100following
101.I std
102is required. If no
103.I offset
104follows
105.IR dst ,
106summer time is assumed to be one hour ahead of standard time. One or
107more digits may be used; the value is always interpreted as a decimal
108number. The hour must be between zero and 24, and the minutes (and
109seconds) \(em if present \(em between zero and 59. If preceded by a
110.RB `` \(mi '',
111the time zone shall be east of the Prime Meridian; otherwise it shall be
112west (which may be indicated by an optional preceding
113.RB `` \(pl '').
114.TP
115.I rule
116Indicates when to change to and back from summer time. The
117.I rule
118has the form:
119.RS
120.IP
121\fIdate\fB/\fItime\fB,\fIdate\fB/\fItime\fR
122.RE
123.IP
124where the first
125.I date
126describes when the change from standard to summer time occurs and the
127second
128.I date
129describes when the change back happens. Each
130.I time
131field describes when, in current local time, the change to the other
132time is made.
133.IP
134The format of
135.I date
136is one of the following:
137.RS
138.TP 10
139.BI J n
140The Julian day
141.I n
142.RI "(1\ \(<=" "\ n\ " "\(<=\ 365).
143Leap days are not counted; that is, in all years \(em including leap
144years \(em February 28 is day 59 and March 1 is day 60. It is
145impossible to explicitly refer to the occasional February 29.
146.TP
147.I n
148The zero-based Julian day
149.RI "(0\ \(<=" "\ n\ " "\(<=\ 365).
150Leap days are counted, and it is possible to refer to February 29.
151.TP
152.BI M m . n . d
153The
154.IR d' th
155day
156.RI "(0\ \(<=" "\ d\ " "\(<=\ 6)
157of week
158.I n
159of month
160.I m
161of the year
162.RI "(1\ \(<=" "\ n\ " "\(<=\ 5,
163.RI "1\ \(<=" "\ m\ " "\(<=\ 12,
164where week 5 means ``the last
165.I d
166day in month
167.IR m ''
168which may occur in either the fourth or the fifth week). Week 1 is the
169first week in which the
170.IR d' th
171day occurs. Day zero is Sunday.
172.RE
173.IP "" 15
174The
175.I time
176has the same format as
177.I offset
178except that no leading sign
179.RB (`` \(mi ''
180or
181.RB `` \(pl '')
182is allowed. The default, if
183.I time
184is not given, is
185.BR 02:00:00 .
186.RE
187.LP
188If no
189.I rule
190is present in
191.BR TZ ,
192the rules specified
193by the
194.IR tzfile (5)-format
195file
196.B posixrules
197in the system time conversion information directory are used, with the
198standard and summer time offsets from UTC replaced by those specified by
199the
200.I offset
201values in
202.BR TZ .
203.PP
204For compatibility with System V Release 3.1, a semicolon
205.RB ( ; )
206may be used to separate the
207.I rule
208from the rest of the specification.
209.PP
210If the
211.B TZ
212environment variable does not specify a
213.IR tzfile (5)-format
214and cannot be interpreted as a direct specification,
215UTC is used.
216.SH FILES
217.ta \w'/usr/local/etc/zoneinfo/posixrules\0\0'u
218/usr/local/etc/zoneinfo time zone information directory
219.br
220/usr/local/etc/zoneinfo/localtime local time zone file
221.br
222/usr/local/etc/zoneinfo/posixrules used with POSIX-style TZ's
223.br
224/usr/local/etc/zoneinfo/GMT for UTC leap seconds
225.sp
226If
227.B /usr/local/etc/zoneinfo/GMT
228is absent,
229UTC leap seconds are loaded from
230.BR /usr/local/etc/zoneinfo/posixrules .
231.SH SEE ALSO
232getenv(3),
233newctime(3),
234time(2),
235tzfile(5)
236.\" @(#)newtzset.3 7.3