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