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