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.5 2008/10/19 20:15:58 swildner Exp $
14 .Op Fl L Ar leapsecondfilename
17 .Op Fl p Ar posixrules
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.
30 the standard input is read.
32 The following options are available:
33 .Bl -tag -width indent
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
41 will instead error out immediately.
43 Create time conversion information files in the named directory rather than
44 in the standard directory named below.
46 After creating each output file, change its group ownership to the
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.
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"
64 (Note that this action has no effect on
66 since the local time zone is specified in
69 .Pa /usr/share/zoneinfo/localtime . )
71 After creating each output file, change its access mode to
73 Both numeric and alphabetic modes are accepted
79 rules when handling POSIX-format
80 time zone environment variables.
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"
88 After creating each output file, change its owner to
90 (which can be either a name or a numeric user ID).
92 Complain if a year that appears in a data file is outside the range
93 of years representable by
96 Also complain if a time of 24:00
97 (which cannot be handled by pre-1998 versions of
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.
109 when checking year types (see below).
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.
123 Names (such as month names) must be in English and are case insensitive.
124 Abbreviations, if used, must be unambiguous in context.
126 A rule line has the form:
127 .Dl "Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S"
129 .Dl "Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D"
131 The fields that make up a rule line are:
132 .Bl -tag -width "LETTER/S" -offset indent
134 Give the (arbitrary) name of the set of rules this rule is part of.
136 Give the first year in which the rule applies.
137 Any integer year can be supplied; the Gregorian calendar is assumed.
140 (or an abbreviation) means the minimum year representable as an integer.
143 (or an abbreviation) means the maximum year representable as an integer.
144 Rules can describe times that are not representable as time values,
145 with the unrepresentable times ignored; this allows rules to be portable
146 among hosts with differing time value types.
148 Give the final year in which the rule applies.
157 may be used to repeat the value of the
161 Give the type of year in which the rule applies.
166 then the rule applies in all years between
173 is something else, then
176 .Li yearistype Ar year Ar type
177 to check the type of a year:
178 an exit status of zero is taken to mean that the year is of the given type;
179 an exit status of one is taken to mean that the year is not of the given type.
181 Name the month in which the rule takes effect.
182 Month names may be abbreviated.
184 Give the day on which the rule takes effect.
185 Recognized forms include:
187 .Bl -tag -width lastSun -compact -offset indent
189 the fifth of the month
191 the last Sunday in the month
193 the last Monday in the month
195 first Sunday on or after the eighth
197 last Sunday on or before the 25th
200 Names of days of the week may be abbreviated or spelled out in full.
201 Note that there must be no spaces within the
205 Give the time of day at which the rule takes effect.
206 Recognized forms include:
208 .Bl -tag -width "\&1:28:14" -offset indent -compact
212 time in hours and minutes
214 24-hour format time (for times after noon)
216 time in hours, minutes, and seconds
221 where hour 0 is midnight at the start of the day,
222 and hour 24 is midnight at the end of the day.
223 Any of these forms may be followed by the letter
225 if the given time is local
229 if the given time is local
237 if the given time is universal time;
238 in the absence of an indicator,
239 wall clock time is assumed.
241 Give the amount of time to be added to local standard time when the rule is in
243 This field has the same format as the
246 (although, of course, the
250 suffixes are not used).
262 of time zone abbreviations to be used when this rule is in effect.
265 the variable part is null.
268 A zone line has the form:
269 .Dl "Zone NAME GMTOFF RULES/SAVE FORMAT [UNTILYEAR [MONTH [DAY [TIME]]]]"
271 .Dl "Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00"
272 The fields that make up a zone line are:
273 .Bl -tag -width indent
275 The name of the time zone.
276 This is the name used in creating the time conversion information file for the
279 The amount of time to add to UTC to get standard time in this zone.
280 This field has the same format as the
284 fields of rule lines;
285 begin the field with a minus sign if time must be subtracted from UTC.
287 The name of the rule(s) that apply in the time zone or,
288 alternately, an amount of time to add to local standard time.
291 then standard time always applies in the time zone.
293 The format for time zone abbreviations in this time zone.
294 The pair of characters
296 is used to show where the
298 of the time zone abbreviation goes.
301 separates standard and daylight abbreviations.
302 .It UNTILYEAR [MONTH [DAY [TIME]]]
303 The time at which the UTC offset or the rule(s) change for a location.
304 It is specified as a year, a month, a day, and a time of day.
305 If this is specified,
306 the time zone information is generated from the given UTC offset
307 and rule change until the time specified.
308 The month, day, and time of day have the same format as the IN, ON, and AT
309 fields of a rule; trailing fields can be omitted, and default to the
310 earliest possible value for the missing fields.
312 The next line must be a
314 line; this has the same form as a zone line except that the
317 and the name are omitted, as the continuation line will
318 place information starting at the time specified as the
320 information in the previous line in the file used by the previous line.
321 Continuation lines may contain
323 information, just as zone lines do, indicating that the next line is a further
327 A link line has the form
328 .Dl "Link LINK-FROM LINK-TO"
330 .Dl "Link Europe/Istanbul Asia/Istanbul"
333 field should appear as the
335 field in some zone line;
338 field is used as an alternate name for that zone.
340 Except for continuation lines,
341 lines may appear in any order in the input.
343 Lines in the file that describes leap seconds have the following form:
344 .Dl "Leap YEAR MONTH DAY HH:MM:SS CORR R/S"
346 .Dl "Leap 1974 Dec 31 23:59:60 + S"
353 fields tell when the leap second happened.
359 if a second was added
362 if a second was skipped.
363 .\" There's no need to document the following, since it's impossible for more
364 .\" than one leap second to be inserted or deleted at a time.
365 .\" The C Standard is in error in suggesting the possibility.
366 .\" See Terry J Quinn, The BIPM and the accurate measure of time,
367 .\" Proc IEEE 79, 7 (July 1991), 894-905.
370 .\" if two seconds were added
373 .\" if two seconds were skipped.
377 should be (an abbreviation of)
379 if the leap second time given by the other fields should be interpreted as UTC
383 if the leap second time given by the other fields should be interpreted as
384 local wall clock time.
385 .Sh "EXTENDED EXAMPLE"
386 Here is an extended example of
388 input, intended to illustrate many of its features.
390 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
391 Rule Swiss 1940 only - Nov 2 0:00 1:00 S
392 Rule Swiss 1940 only - Dec 31 0:00 0 -
393 Rule Swiss 1941 1942 - May Sun>=1 2:00 1:00 S
394 Rule Swiss 1941 1942 - Oct Sun>=1 0:00 0
396 Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S
397 Rule EU 1977 only - Sep lastSun 1:00u 0 -
398 Rule EU 1978 only - Oct 1 1:00u 0 -
399 Rule EU 1979 1995 - Sep lastSun 1:00u 0 -
400 Rule EU 1981 max - Mar lastSun 1:00u 1:00 S
401 Rule EU 1996 max - Oct lastSun 1:00u 0 -
403 # Zone NAME GMTOFF RULES FORMAT UNTIL
404 Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
405 0:29:44 - BMT 1894 Jun
406 1:00 Swiss CE%sT 1981
409 Link Europe/Zurich Switzerland
412 In this example, the zone is named Europe/Zurich but it has an alias
414 Zurich was 34 minutes and 8 seconds west of GMT until
415 1848-09-12 at 00:00, when the offset changed to 29 minutes and 44
417 After 1894-06-01 at 00:00 Swiss daylight saving rules (defined
418 with lines beginning with
420 apply, and the GMT offset became one hour.
421 From 1981 to the present, EU daylight saving rules have
422 applied, and the UTC offset has remained at one hour.
424 In 1940, daylight saving time applied from November 2 at 00:00 to
425 December 31 at 00:00.
426 In 1941 and 1942, daylight saving time applied
427 from the first Sunday in May at 02:00 to the first Sunday in October
429 The pre-1981 EU daylight-saving rules have no effect
430 here, but are included for completeness.
432 saving has begun on the last Sunday in March at 01:00 UTC.
433 Until 1995 it ended the last Sunday in September at 01:00 UTC,
434 but this changed to the last Sunday in October starting in 1996.
441 were initially used, respectively.
443 Swiss rules and later EU rules were applied, the display name for the
444 timezone has been CET for standard time and CEST for daylight saving
447 For areas with more than two types of local time,
448 you may need to use local standard time in the
450 field of the earliest transition time's rule to ensure that
451 the earliest transition time recorded in the compiled file is correct.
454 for a particular zone,
455 a clock advance caused by the start of daylight saving
456 coincides with and is equal to
457 a clock retreat caused by a change in UTC offset,
459 produces a single transition to daylight saving at the new UTC offset
460 (without any change in wall clock time).
461 To get separate transitions
462 use multiple zone continuation lines
463 specifying transition instants using universal time.
465 .Bl -tag -width ".Pa /usr/share/zoneinfo" -compact
466 .It Pa /usr/share/zoneinfo
467 standard directory used for created files