386BSD 0.1 development
[unix-history] / usr / othersrc / share / zoneinfo / zic.8
CommitLineData
d861d7ec
WJ
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Arthur David Olson of the National Cancer Institute.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
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. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" @(#)zic.8 5.2 (Berkeley) 4/20/91
36.\"
37.TH ZIC 8
38.SH NAME
39zic \- time zone compiler
40.SH SYNOPSIS
41.B zic
42[
43.B \-v
44] [
45.B \-d
46.I directory
47] [
48.B \-l
49.I localtime
50] [
51.B \-p
52.I posixrules
53] [
54.B \-L
55.I leapsecondfilename
56] [
57.B \-s
58] [
59.I filename
60\&... ]
61.SH DESCRIPTION
62.if t .ds lq ``
63.if t .ds rq ''
64.if n .ds lq \&"\"
65.if n .ds rq \&"\"
66.de q
67\\$3\*(lq\\$1\*(rq\\$2
68..
69.I Zic
70reads text from the file(s) named on the command line
71and creates the time conversion information files specified in this input.
72If a
73.I filename
74is
75.BR \- ,
76the standard input is read.
77.PP
78These options are available:
79.TP
80.BI "\-d " directory
81Create time conversion information files in the named directory rather than
82in the standard directory named below.
83.TP
84.BI "\-l " timezone
85Use the given time zone as local time.
86.I Zic
87will act as if the input contained a link line of the form
88.sp
89.ti +.5i
90Link \fItimezone\fP localtime
91.TP
92.BI "\-p " timezone
93Use the given time zone's rules when handling POSIX-format
94time zone environment variables.
95.I Zic
96will act as if the input contained a link line of the form
97.sp
98.ti +.5i
99Link \fItimezone\fP posixrules
100.TP
101.BI "\-L " leapsecondfilename
102Read leap second information from the file with the given name.
103If this option is not used,
104no leap second information appears in output files.
105.TP
106.B \-v
107Complain if a year that appears in a data file is outside the range
108of years representable by
109.IR time (2)
110values.
111.TP
112.B \-s
113Limit time values stored in output files to values that are the same
114whether they're taken to be signed or unsigned.
115You can use this option to generate SVVS-compatible files.
116.sp
117Input lines are made up of fields.
118Fields are separated from one another by any number of white space characters.
119Leading and trailing white space on input lines is ignored.
120An unquoted sharp character (#) in the input introduces a comment which extends
121to the end of the line the sharp character appears on.
122White space characters and sharp characters may be enclosed in double quotes
123(") if they're to be used as part of a field.
124Any line that is blank (after comment stripping) is ignored.
125Non-blank lines are expected to be of one of three types:
126rule lines, zone lines, and link lines.
127.PP
128A rule line has the form
129.nf
130.B
131.ti +.5i
132.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u
133.sp
134Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
135.sp
136For example:
137.ti +.5i
138.sp
139Rule USA 1969 1973 \- Apr lastSun 2:00 1:00 D
140.sp
141.fi
142The fields that make up a rule line are:
143.TP "\w'LETTER/S'u"
144.B NAME
145Gives the (arbitrary) name of the set of rules this rule is part of.
146.TP
147.B FROM
148Gives the first year in which the rule applies.
149The word
150.B minimum
151(or an abbreviation) means the minimum year with a representable time value.
152The word
153.B maximum
154(or an abbreviation) means the maximum year with a representable time value.
155.TP
156.B TO
157Gives the final year in which the rule applies.
158In addition to
159.B minimum
160and
161.B maximum
162(as above),
163the word
164.B only
165(or an abbreviation)
166may be used to repeat the value of the
167.B FROM
168field.
169.TP
170.B TYPE
171Gives the type of year in which the rule applies.
172If
173.B TYPE
174is
175.B \-
176then the rule applies in all years between
177.B FROM
178and
179.B TO
180inclusive;
181if
182.B TYPE
183is
184.BR uspres ,
185the rule applies in U.S. Presidential election years;
186if
187.B TYPE
188is
189.BR nonpres ,
190the rule applies in years other than U.S. Presidential election years.
191If
192.B TYPE
193is something else, then
194.I zic
195executes the command
196.ti +.5i
197\fByearistype\fP \fIyear\fP \fItype\fP
198.br
199to check the type of a year:
200an exit status of zero is taken to mean that the year is of the given type;
201an exit status of one is taken to mean that the year is not of the given type.
202.TP
203.B IN
204Names the month in which the rule takes effect.
205Month names may be abbreviated.
206.TP
207.B ON
208Gives the day on which the rule takes effect.
209Recognized forms include:
210.nf
211.in +.5i
212.sp
213.ta \w'Sun<=25\0\0'u
2145 the fifth of the month
215lastSun the last Sunday in the month
216lastMon the last Monday in the month
217Sun>=8 first Sunday on or after the eighth
218Sun<=25 last Sunday on or before the 25th
219.fi
220.in -.5i
221.sp
222Names of days of the week may be abbreviated or spelled out in full.
223Note that there must be no spaces within the
224.B ON
225field.
226.TP
227.B AT
228Gives the time of day at which the rule takes effect.
229Recognized forms include:
230.nf
231.in +.5i
232.sp
233.ta \w'1:28:13\0\0'u
2342 time in hours
2352:00 time in hours and minutes
23615:00 24-hour format time (for times after noon)
2371:28:14 time in hours, minutes, and seconds
238.fi
239.in -.5i
240.sp
241Any of these forms may be followed by the letter
242.B w
243if the given time is local
244.q "wall clock"
245time or
246.B s
247if the given time is local
248.q standard
249time; in the absence of
250.B w
251or
252.BR s ,
253wall clock time is assumed.
254.TP
255.B SAVE
256Gives the amount of time to be added to local standard time when the rule is in
257effect.
258This field has the same format as the
259.B AT
260field
261(although, of course, the
262.B w
263and
264.B s
265suffixes are not used).
266.TP
267.B LETTER/S
268Gives the
269.q "variable part"
270(for example, the
271.q S
272or
273.q D
274in
275.q EST
276or
277.q EDT )
278of time zone abbreviations to be used when this rule is in effect.
279If this field is
280.BR \- ,
281the variable part is null.
282.PP
283A zone line has the form
284.sp
285.nf
286.ti +.5i
287.ta \w'Zone\0\0'u +\w'Australia/South\-west\0\0'u +\w'GMTOFF\0\0'u +\w'RULES/SAVE\0\0'u +\w'FORMAT\0\0'u
288Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
289.sp
290For example:
291.sp
292.ti +.5i
293Zone Australia/South\-west 9:30 Aus CST 1987 Mar 15 2:00
294.sp
295.fi
296The fields that make up a zone line are:
297.TP "\w'GMTOFF'u"
298.B NAME
299The name of the time zone.
300This is the name used in creating the time conversion information file for the
301zone.
302.TP
303.B GMTOFF
304The amount of time to add to GMT to get standard time in this zone.
305This field has the same format as the
306.B AT
307and
308.B SAVE
309fields of rule lines;
310begin the field with a minus sign if time must be subtracted from GMT.
311.TP
312.B RULES/SAVE
313The name of the rule(s) that apply in the time zone or,
314alternately, an amount of time to add to local standard time.
315If this field is
316.B \-
317then standard time always applies in the time zone.
318.TP
319.B FORMAT
320The format for time zone abbreviations in this time zone.
321The pair of characters
322.B %s
323is used to show where the
324.q "variable part"
325of the time zone abbreviation goes.
326.TP
327.B UNTIL
328The time at which the GMT offset or the rule(s) change for a location.
329It is specified as a year, a month, a day, and a time of day.
330If this is specified,
331the time zone information is generated from the given GMT offset
332and rule change until the time specified.
333.IP
334The next line must be a
335.q continuation
336line; this has the same form as a zone line except that the
337string
338.q Zone
339and the name are omitted, as the continuation line will
340place information starting at the time specified as the
341.B UNTIL
342field in the previous line in the file used by the previous line.
343Continuation lines may contain an
344.B UNTIL
345field, just as zone lines do, indicating that the next line is a further
346continuation.
347.PP
348A link line has the form
349.sp
350.nf
351.ti +.5i
352.if t .ta \w'Link\0\0'u +\w'LINK-FROM\0\0'u
353.if n .ta \w'Link\0\0'u +\w'US/Eastern\0\0'u
354Link LINK-FROM LINK-TO
355.sp
356For example:
357.sp
358.ti +.5i
359Link US/Eastern EST5EDT
360.sp
361.fi
362The
363.B LINK-FROM
364field should appear as the
365.B NAME
366field in some zone line;
367the
368.B LINK-TO
369field is used as an alternate name for that zone.
370.PP
371Except for continuation lines,
372lines may appear in any order in the input.
373.PP
374Lines in the file that describes leap seconds have the following form:
375.nf
376.B
377.ti +.5i
378.ta \w'Leap\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +\w'HH:MM:SS\0\0'u +\w'CORR\0\0'u
379Leap YEAR MONTH DAY HH:MM:SS CORR R/S
380.sp
381For example:
382.ti +.5i
383.sp
384Leap 1974 Dec 31 23:59:60 + S
385.sp
386.fi
387The
388.BR YEAR ,
389.BR MONTH ,
390.BR DAY ,
391and
392.B HH:MM:SS
393fields tell when the leap second happened.
394The
395.B CORR
396field
397should be
398.q +
399if a second was added
400or
401.q -
402if a second was skipped.
403The
404.B R/S
405field
406should be (an abbreviation of)
407.q Stationary
408if the leap second time given by the other fields should be interpreted as GMT
409or
410(an abbreviation of)
411.q Rolling
412if the leap second time given by the other fields should be interpreted as
413local wall clock time.
414.SH NOTE
415For areas with more than two types of local time,
416you may need to use local standard time in the
417.B AT
418field of the earliest transition time's rule to ensure that
419the earliest transition time recorded in the compiled file is correct.
420.SH FILE
421/etc/zoneinfo standard directory used for created files
422.SH "SEE ALSO"
423newctime(3), tzfile(5), zdump(8)
424.. @(#)zic.8 4.4