Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / zic / zic.8
CommitLineData
984263bc
MD
1.\" $FreeBSD: src/usr.sbin/zic/zic.8,v 1.11.2.4 2003/03/11 22:31:35 trhodes Exp $
2.Dd October 29, 1997
3.Dt ZIC 8
4.Os
5.Sh NAME
6.Nm zic
7.Nd timezone compiler
8.Sh SYNOPSIS
9.Nm
10.Op Fl Dsv
11.Op Fl d Ar directory
12.Op Fl g Ar group
13.Op Fl L Ar leapsecondfilename
14.Op Fl l Ar localtime
15.Op Fl m Ar mode
16.Op Fl p Ar posixrules
17.Op Fl u Ar user
18.Op Fl y Ar command
19.Op Ar filename ...
20.Sh DESCRIPTION
21The
22.Nm
23utility reads text from the file(s) named on the command line
24and creates the time conversion information files specified in this input.
25If a
26.Ar filename
27is
28.Em - ,
29the standard input is read.
30.Pp
31The following options are available:
32.Bl -tag -width indent
33.It Fl D
34Do not automatically create directories. If the input file(s) specify
35an output file in a directory which does not already exist, the
36default behavior is to attempt to create the directory. If
37.Fl D
38is specified,
39.Nm
40will instead error out immediately.
41.It Fl d Ar directory
42Create time conversion information files in the named directory rather than
43in the standard directory named below.
44.It Fl g Ar group
45After creating each output file, change its group ownership to the
46specified
47.Ar group
48(which can be either a name or a numeric group ID).
49.It Fl L Ar leapsecondfilename
50Read leap second information from the file with the given name.
51If this option is not used,
52no leap second information appears in output files.
53.It Fl l Ar timezone
54Use the given
55.Ar time zone
56as local time.
57The
58.Nm
59utility will act as if the input contained a link line of the form
60.Bd -literal -offset indent
61.No "Link timezone localtime
62.Ed
63(Note that this action has no effect on
64.Fx ,
65since the local time zone is specified in
66.Pa /etc/localtime
67and not
68.Pa /usr/share/zoneinfo/localtime . )
69.It Fl m Ar mode
70After creating each output file, change its access mode to
71.Ar mode .
72Both numeric and alphabetic modes are accepted
73(see
74.Xr chmod 1 ) .
75.It Fl p Ar timezone
76Use the given
77.Ar "time zone" Ns 's
78rules when handling POSIX-format
79time zone environment variables.
80The
81.Nm
82utility will act as if the input contained a link line of the form
83.Bd -literal -offset indent
84.No "Link timezone posixrules
85.Ed
86.It Fl u Ar user
87After creating each output file, change its owner to
88.Ar user
89(which can be either a name or a numeric user ID).
90.It Fl v
91Complain if a year that appears in a data file is outside the range
92of years representable by
93.Xr time 3
94values.
95.It Fl s
96Limit time values stored in output files to values that are the same
97whether they're taken to be signed or unsigned.
98You can use this option to generate SVVS-compatible files.
99.It Fl y Ar command
100Use the given
101.Ar command
102rather than
103.Em yearistype
104when checking year types (see below).
105.El
106.Pp
107Input lines are made up of fields.
108Fields are separated from one another by any number of white space characters.
109Leading and trailing white space on input lines is ignored.
110An unquoted sharp character (#) in the input introduces a comment which extends
111to the end of the line the sharp character appears on.
112White space characters and sharp characters may be enclosed in double quotes
113(") if they're to be used as part of a field.
114Any line that is blank (after comment stripping) is ignored.
115Non-blank lines are expected to be of one of three types:
116rule lines, zone lines, and link lines.
117.Pp
118A rule line has the form:
119.Dl "Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
120For example:
121.Dl "Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D
122.Pp
123The fields that make up a rule line are:
124.Bl -tag -width "LETTER/S" -offset indent
125.It NAME
126Give the (arbitrary) name of the set of rules this rule is part of.
127.It FROM
128Give the first year in which the rule applies.
129Any integer year can be supplied; the Gregorian calendar is assumed.
130The word
131.Em minimum
132(or an abbreviation) means the minimum year representable as an integer.
133The word
134.Em maximum
135(or an abbreviation) means the maximum year representable as an integer.
136Rules can describe times that are not representable as time values,
137with the unrepresentable times ignored; this allows rules to be portable
138among hosts with differing time value types.
139.It TO
140Give the final year in which the rule applies.
141In addition to
142.Em minimum
143and
144.Em maximum
145(as above),
146the word
147.Em only
148(or an abbreviation)
149may be used to repeat the value of the
150.Em FROM
151field.
152.It TYPE
153Give the type of year in which the rule applies.
154If
155.Em TYPE
156is
157.Em \-
158then the rule applies in all years between
159.Em FROM
160and
161.Em TO
162inclusive.
163If
164.Em TYPE
165is something else, then
166.Nm
167executes the command
168.Li yearistype Ar year Ar type
169to check the type of a year:
170an exit status of zero is taken to mean that the year is of the given type;
171an exit status of one is taken to mean that the year is not of the given type.
172.It IN
173Name the month in which the rule takes effect.
174Month names may be abbreviated.
175.It ON
176Give the day on which the rule takes effect.
177Recognized forms include:
178.Pp
179.Bl -tag -width lastSun -compact -offset indent
180.It \&5
181the fifth of the month
182.It lastSun
183the last Sunday in the month
184.It lastMon
185the last Monday in the month
186.It Sun>=8
187first Sunday on or after the eighth
188.It Sun<=25
189last Sunday on or before the 25th
190.El
191.Pp
192Names of days of the week may be abbreviated or spelled out in full.
193Note that there must be no spaces within the
194.Em ON
195field.
196.It AT
197Give the time of day at which the rule takes effect.
198Recognized forms include:
199.Pp
200.Bl -tag -width "\&1:28:14" -offset indent -compact
201.It 2
202time in hours
203.It 2:00
204time in hours and minutes
205.It 15:00
20624-hour format time (for times after noon)
207.It 1:28:14
208time in hours, minutes, and seconds
209.El
210.Pp
211where hour 0 is midnight at the start of the day,
212and hour 24 is midnight at the end of the day.
213Any of these forms may be followed by the letter
214.Sq Li w
215if the given time is local
216.Dq "wall clock"
217time,
218.Sq Li s
219if the given time is local
220.Dq standard
221time, or
222.Sq Li u
223(or
224.Sq Li g
225or
226.Sq Li z )
227if the given time is universal time;
228in the absence of an indicator,
229wall clock time is assumed.
230.It SAVE
231Give the amount of time to be added to local standard time when the rule is in
232effect.
233This field has the same format as the
234.Em AT
235field
236(although, of course, the
237.Sq Li w
238and
239.Sq Li s
240suffixes are not used).
241.It LETTER/S
242Give the
243.Dq "variable part"
244(for example, the
245.Dq S
246or
247.Dq D
248in
249.Dq EST
250or
251.Dq EDT )
252of time zone abbreviations to be used when this rule is in effect.
253If this field is
254.Em \- ,
255the variable part is null.
256.El
257.Pp
258A zone line has the form:
259.Dl "Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
260For example:
261.Dl "Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00
262The fields that make up a zone line are:
263.Bl -tag -width indent
264.It NAME
265The name of the time zone.
266This is the name used in creating the time conversion information file for the
267zone.
268.It GMTOFF
269The amount of time to add to UTC to get standard time in this zone.
270This field has the same format as the
271.Em AT
272and
273.Em SAVE
274fields of rule lines;
275begin the field with a minus sign if time must be subtracted from UTC.
276.It RULES/SAVE
277The name of the rule(s) that apply in the time zone or,
278alternately, an amount of time to add to local standard time.
279If this field is
280.Em \-
281then standard time always applies in the time zone.
282.It FORMAT
283The format for time zone abbreviations in this time zone.
284The pair of characters
285.Em %s
286is used to show where the
287.Dq "variable part"
288of the time zone abbreviation goes.
289Alternately,
290a slash (/)
291separates standard and daylight abbreviations.
292.It UNTIL
293The time at which the UTC offset or the rule(s) change for a location.
294It is specified as a year, a month, a day, and a time of day.
295If this is specified,
296the time zone information is generated from the given UTC offset
297and rule change until the time specified.
298The month, day, and time of day have the same format as the IN, ON, and AT
299columns of a rule; trailing columns can be omitted, and default to the
300earliest possible value for the missing columns.
301.Pp
302The next line must be a
303.Dq continuation
304line; this has the same form as a zone line except that the
305string
306.Dq Zone
307and the name are omitted, as the continuation line will
308place information starting at the time specified as the
309.Em UNTIL
310field in the previous line in the file used by the previous line.
311Continuation lines may contain an
312.Em UNTIL
313field, just as zone lines do, indicating that the next line is a further
314continuation.
315.El
316.Pp
317A link line has the form
318.Dl "Link LINK-FROM LINK-TO
319For example:
320.Dl "Link Europe/Istanbul Asia/Istanbul
321The
322.Em LINK-FROM
323field should appear as the
324.Em NAME
325field in some zone line;
326the
327.Em LINK-TO
328field is used as an alternate name for that zone.
329.Pp
330Except for continuation lines,
331lines may appear in any order in the input.
332.Pp
333Lines in the file that describes leap seconds have the following form:
334.Dl "Leap YEAR MONTH DAY HH:MM:SS CORR R/S
335For example:
336.Dl "Leap 1974 Dec 31 23:59:60 + S
337The
338.Em YEAR ,
339.Em MONTH ,
340.Em DAY ,
341and
342.Em HH:MM:SS
343fields tell when the leap second happened.
344The
345.Em CORR
346field
347should be
348.Dq +
349if a second was added
350or
351.Dq -
352if a second was skipped.
353.\" There's no need to document the following, since it's impossible for more
354.\" than one leap second to be inserted or deleted at a time.
355.\" The C Standard is in error in suggesting the possibility.
356.\" See Terry J Quinn, The BIPM and the accurate measure of time,
357.\" Proc IEEE 79, 7 (July 1991), 894-905.
358.\" or
359.\" .q ++
360.\" if two seconds were added
361.\" or
362.\" .q --
363.\" if two seconds were skipped.
364The
365.Em R/S
366field
367should be (an abbreviation of)
368.Dq Stationary
369if the leap second time given by the other fields should be interpreted as UTC
370or
371(an abbreviation of)
372.Dq Rolling
373if the leap second time given by the other fields should be interpreted as
374local wall clock time.
375.Sh NOTE
376For areas with more than two types of local time,
377you may need to use local standard time in the
378.Em AT
379field of the earliest transition time's rule to ensure that
380the earliest transition time recorded in the compiled file is correct.
381.Sh FILES
382.Bl -tag -width /usr/share/zoneinfo -compact
383.It /usr/share/zoneinfo
384standard directory used for created files
385.El
386.Sh "SEE ALSO"
387.Xr ctime 3 ,
388.Xr tzfile 5 ,
389.Xr zdump 8
390.\" @(#)zic.8 7.18