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