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