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