1 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
2 .\" This page is in the public domain
5 .TH ZIC 8 2020-08-13 "" "Linux System Administration"
7 zic \- timezone compiler
16 .ie '\(lq'' .ds lq \&"\"
18 .ie '\(rq'' .ds rq \&"\"
21 \\$3\*(lq\\$1\*(rq\\$2
37 program reads text from the file(s) named on the command line
38 and creates the time conversion information files specified in this input.
43 standard input is read.
47 Output version information and exit.
50 Output short usage message and exit.
53 Output backward-compatibility data as specified by
59 generate additional data entries that work around potential bugs or
60 incompatibilities in older software, such as software that mishandles
61 the 64-bit generated data.
66 keep the output files small; this can help check for the bugs
67 and incompatibilities.
68 Although the default is currently
70 this is intended to change in future
72 versions, as software that mishandles the 64-bit data typically
73 mishandles timestamps after the year 2038 anyway.
76 option for another way to shrink output size.
79 Create time conversion information files in the named directory rather than
80 in the standard directory named below.
87 will act as if the input contained a link line of the form
90 .ta \w'Link\0\0'u +\w'\fItimezone\fP\0\0'u
91 Link \fItimezone\fP localtime
93 .BI "\*-L " leapsecondfilename
94 Read leap second information from the file with the given name.
95 If this option is not used,
96 no leap second information appears in output files.
101 rules when handling nonstandard
102 TZ strings like "EET\*-2EEST" that lack transition rules.
104 will act as if the input contained a link line of the form
107 Link \fItimezone\fP posixrules
109 This feature is obsolete and poorly supported.
110 Among other things it should not be used for timestamps after the year 2037,
111 and it should not be combined with
115 transitions are at standard time or Universal Time (UT) instead of local time.
117 .BR "\*-r " "[\fB@\fP\fIlo\fP][\fB/@\fP\fIhi\fP]"
118 Reduce the size of output files by limiting their applicability
119 to timestamps in the range from
127 are possibly-signed decimal counts of seconds since the Epoch
128 (1970-01-01 00:00:00 UTC).
129 Omitted counts default to extreme values.
132 omits data intended for negative timestamps (i.e., before the Epoch), and
133 .q "zic \*-r @0/@2147483648"
134 outputs data intended only for nonnegative timestamps that fit into
135 31-bit signed integers.
136 On platforms with GNU
138 .q "zic \-r @$(date +%s)"
139 omits data intended for past timestamps.
142 option for another way to shrink output size.
145 When creating local time information, put the configuration link in
146 the named file rather than in the standard location.
149 Be more verbose, and complain about the following situations:
152 The input specifies a link to a link.
154 A year that appears in a data file is outside the range
155 of representable years.
157 A time of 24:00 or more appears in the input.
160 prohibit 24:00, and pre-2007 versions prohibit times greater than 24:00.
162 A rule goes past the start or end of the month.
167 A time zone abbreviation uses a
174 A timestamp contains fractional seconds.
179 The input contains abbreviations that are mishandled by pre-2018 versions of
181 due to a longstanding coding bug.
182 These abbreviations include
197 The output file does not contain all the information about the
198 long-term future of a timezone, because the future cannot be summarized as
199 an extended POSIX TZ string. For example, as of 2019 this problem
200 occurs for Iran's daylight-saving rules for the predicted future, as
201 these rules are based on the Iranian calendar, which cannot be
204 The output contains data that may not be handled properly by client
205 code designed for older
207 output formats. These compatibility issues affect only timestamps
208 before 1970 or after the start of 2038.
210 The output file contains more than 1200 transitions,
211 which may be mishandled by some clients.
212 The current reference client supports at most 2000 transitions;
213 pre-2014 versions of the reference client support at most 1200
216 A time zone abbreviation has fewer than 3 or more than 6 characters.
217 POSIX requires at least 3, and requires implementations to support
220 An output file name contains a byte that is not an ASCII letter,
225 or it contains a file name component that contains more than 14 bytes
230 Input files use the format described in this section; output files use
234 Input files should be text files, that is, they should be a series of
235 zero or more lines, each ending in a newline byte and containing at
236 most 511 bytes, and without any NUL bytes. The input text's encoding
237 is typically UTF-8 or ASCII; it should have a unibyte representation
238 for the POSIX Portable Character Set (PPCS)
239 \*<http://pubs\*:.opengroup\*:.org/\*:onlinepubs/\*:9699919799/\*:basedefs/\*:V1_chap06\*:.html\*>
240 and the encoding's non-unibyte characters should consist entirely of
241 non-PPCS bytes. Non-PPCS characters typically occur only in comments:
242 although output file names and time zone abbreviations can contain
243 nearly any character, other software will work better if these are
244 limited to the restricted syntax described under the
248 Input lines are made up of fields.
249 Fields are separated from one another by one or more white space characters.
250 The white space characters are space, form feed, carriage return, newline,
251 tab, and vertical tab.
252 Leading and trailing white space on input lines is ignored.
253 An unquoted sharp character (#) in the input introduces a comment which extends
254 to the end of the line the sharp character appears on.
255 White space characters and sharp characters may be enclosed in double quotes
256 (") if they're to be used as part of a field.
257 Any line that is blank (after comment stripping) is ignored.
258 Nonblank lines are expected to be of one of three types:
259 rule lines, zone lines, and link lines.
261 Names must be in English and are case insensitive.
262 They appear in several contexts, and include month and weekday names
269 A name can be abbreviated by omitting all but an initial prefix; any
270 abbreviation must be unambiguous in context.
272 A rule line has the form
275 .ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00w\0\0'u +\w'1:00d\0\0'u
277 Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
282 Rule US 1967 1973 \*- Apr lastSun 2:00w 1:00d D
285 The fields that make up a rule line are:
288 Gives the name of the rule set that contains this line.
289 The name must start with a character that is neither
294 To allow for future extensions,
295 an unquoted name should not contain characters from the set
296 .q !$%&'()*,/:;<=>?@[\e]\(ha\`{|}\(ti .
299 Gives the first year in which the rule applies.
300 Any signed integer year can be supplied; the proleptic Gregorian calendar
301 is assumed, with year 0 preceding year 1.
304 (or an abbreviation) means the indefinite past.
307 (or an abbreviation) means the indefinite future.
308 Rules can describe times that are not representable as time values,
309 with the unrepresentable times ignored; this allows rules to be portable
310 among hosts with differing time value types.
313 Gives the final year in which the rule applies.
322 may be used to repeat the value of the
329 and is present for compatibility with older versions of
331 in which it could contain year types.
334 Names the month in which the rule takes effect.
335 Month names may be abbreviated.
338 Gives the day on which the rule takes effect.
339 Recognized forms include:
344 5 the fifth of the month
345 lastSun the last Sunday in the month
346 lastMon the last Monday in the month
347 Sun>=8 first Sunday on or after the eighth
348 Sun<=25 last Sunday on or before the 25th
352 A weekday name (e.g.,
354 or a weekday name preceded by
358 may be abbreviated or spelled out in full.
359 There must be no white space characters within the
366 constructs can result in a day in the neighboring month;
367 for example, the IN-ON combination
369 stands for the first Sunday on or after October 31,
370 even if that Sunday occurs in November.
373 Gives the time of day at which the rule takes effect,
374 relative to 00:00, the start of a calendar day.
375 Recognized forms include:
379 .ta \w'00:19:32.13\0\0'u
381 2:00 time in hours and minutes
382 01:28:14 time in hours, minutes, and seconds
383 00:19:32.13 time with fractional seconds
384 12:00 midday, 12 hours after 00:00
385 15:00 3 PM, 15 hours after 00:00
386 24:00 end of day, 24 hours after 00:00
387 260:00 260 hours after 00:00
388 \*-2:30 2.5 hours before 00:00
395 rounds times to the nearest integer second
396 (breaking ties to the even integer), the fractions may be useful
397 to other applications requiring greater precision.
398 The source format does not specify any maximum precision.
399 Any of these forms may be followed by the letter
401 if the given time is local or
405 if the given time is standard time without any adjustment for daylight saving,
412 if the given time is universal time;
413 in the absence of an indicator,
414 local (wall clock) time is assumed.
415 These forms ignore leap seconds; for example,
416 if a leap second occurs at 00:59:60 local time,
418 stands for 3601 seconds after local midnight instead of the usual 3600 seconds.
419 The intent is that a rule line describes the instants when a
420 clock/calendar set to the type of time specified in the
422 field would show the specified date and time of day.
425 Gives the amount of time to be added to local standard time when the rule is in
426 effect, and whether the resulting time is standard or daylight saving.
427 This field has the same format as the
430 except with a different set of suffix letters:
432 for standard time and
434 for daylight saving time.
435 The suffix letter is typically omitted, and defaults to
437 if the offset is zero and to
440 Negative offsets are allowed; in Ireland, for example, daylight saving
441 time is observed in winter and has a negative offset relative to
443 The offset is merely added to standard time; for example,
445 does not distinguish a 10:30 standard time plus an 0:30
447 from a 10:00 standard time plus a 1:00
461 of time zone abbreviations to be used when this rule is in effect.
464 the variable part is null.
466 A zone line has the form
470 .ta \w'Zone\0\0'u +\w'Asia/Amman\0\0'u +\w'STDOFF\0\0'u +\w'Jordan\0\0'u +\w'FORMAT\0\0'u
471 Zone NAME STDOFF RULES FORMAT [UNTIL]
476 Zone Asia/Amman 2:00 Jordan EE%sT 2017 Oct 27 01:00
479 The fields that make up a zone line are:
482 The name of the timezone.
483 This is the name used in creating the time conversion information file for the
485 It should not contain a file name component
489 a file name component is a maximal substring that does not contain
493 The amount of time to add to UT to get standard time,
494 without any adjustment for daylight saving.
495 This field has the same format as the
499 fields of rule lines;
500 begin the field with a minus sign if time must be subtracted from UT.
503 The name of the rules that apply in the timezone or,
504 alternatively, a field in the same format as a rule-line SAVE column,
505 giving of the amount of time to be added to local standard time
506 effect, and whether the resulting time is standard or daylight saving.
509 then standard time always applies.
510 When an amount of time is given, only the sum of standard time and
514 The format for time zone abbreviations.
515 The pair of characters
517 is used to show where the
519 of the time zone abbreviation goes.
520 Alternatively, a format can use the pair of characters
522 to stand for the UT offset in the form
527 using the shortest form that does not lose information, where
532 are the hours, minutes, and seconds east (+) or west (\(mi) of UT.
535 separates standard and daylight abbreviations.
536 To conform to POSIX, a time zone abbreviation should contain only
537 alphanumeric ASCII characters,
543 The time at which the UT offset or the rule(s) change for a location.
544 It takes the form of one to four fields YEAR [MONTH [DAY [TIME]]].
545 If this is specified,
546 the time zone information is generated from the given UT offset
547 and rule change until the time specified, which is interpreted using
548 the rules in effect just before the transition.
549 The month, day, and time of day have the same format as the IN, ON, and AT
550 fields of a rule; trailing fields can be omitted, and default to the
551 earliest possible value for the missing fields.
553 The next line must be a
555 line; this has the same form as a zone line except that the
558 and the name are omitted, as the continuation line will
559 place information starting at the time specified as the
561 information in the previous line in the file used by the previous line.
562 Continuation lines may contain
564 information, just as zone lines do, indicating that the next line is a further
567 If a zone changes at the same instant that a rule would otherwise take
568 effect in the earlier zone or continuation line, the rule is ignored.
569 A zone or continuation line
571 with a named rule set starts with standard time by default:
576 earliest rule use the rule in effect after
578 first transition into standard time.
579 In a single zone it is an error if two rules take effect at the same
580 instant, or if two zone changes take effect at the same instant.
582 A link line has the form
586 .ta \w'Link\0\0'u +\w'Europe/Istanbul\0\0'u
587 Link TARGET LINK-NAME
592 Link Europe/Istanbul Asia/Istanbul
597 field should appear as the
599 field in some zone line.
602 field is used as an alternative name for that zone;
603 it has the same syntax as a zone line's
607 Except for continuation lines,
608 lines may appear in any order in the input.
609 However, the behavior is unspecified if multiple zone or link lines
610 define the same name, or if the source of one link line is the target
613 The file that describes leap seconds can have leap lines and an
615 Leap lines have the following form:
618 .ta \w'Leap\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +\w'HH:MM:SS\0\0'u +\w'CORR\0\0'u
620 Leap YEAR MONTH DAY HH:MM:SS CORR R/S
625 Leap 2016 Dec 31 23:59:60 + S
634 fields tell when the leap second happened.
640 if a second was added
643 if a second was skipped.
647 should be (an abbreviation of)
649 if the leap second time given by the other fields should be interpreted as UTC
653 if the leap second time given by the other fields should be interpreted as
654 local (wall clock) time.
656 The expiration line, if present, has the form:
659 .ta \w'Expires\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u
661 Expires YEAR MONTH DAY HH:MM:SS
666 Expires 2020 Dec 28 00:00:00
675 fields give the expiration timestamp in UTC for the leap second table;
677 outputs this expiration timestamp by truncating the end of the output
678 file to the timestamp.
679 If there is no expiration line,
681 also accepts a comment
682 .q "#expires \fIE\fP ...\&"
685 is the expiration timestamp as a decimal integer count of seconds
686 since the Epoch, not counting leap seconds.
689 comment is an obsolescent feature,
690 and the leap second file should use an expiration line
691 instead of relying on a comment.
692 .SH "EXTENDED EXAMPLE"
693 Here is an extended example of
695 input, intended to illustrate many of its features.
696 In this example, the EU rules are for the European Union
697 and for its predecessor organization, the European Communities.
702 .ta \w'# Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u
704 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
705 Rule Swiss 1941 1942 \*- May Mon>=1 1:00 1:00 S
706 Rule Swiss 1941 1942 \*- Oct Mon>=1 2:00 0 \*-
708 Rule EU 1977 1980 \*- Apr Sun>=1 1:00u 1:00 S
709 Rule EU 1977 only \*- Sep lastSun 1:00u 0 \*-
710 Rule EU 1978 only \*- Oct 1 1:00u 0 \*-
711 Rule EU 1979 1995 \*- Sep lastSun 1:00u 0 \*-
712 Rule EU 1981 max \*- Mar lastSun 1:00u 1:00 S
713 Rule EU 1996 max \*- Oct lastSun 1:00u 0 \*-
715 .ta \w'# Zone\0\0'u +\w'Europe/Zurich\0\0'u +\w'0:29:45.50\0\0'u +\w'RULES\0\0'u +\w'FORMAT\0\0'u
716 # Zone NAME STDOFF RULES FORMAT [UNTIL]
717 Zone Europe/Zurich 0:34:08 \*- LMT 1853 Jul 16
718 0:29:45.50 \*- BMT 1894 Jun
719 1:00 Swiss CE%sT 1981
722 Link Europe/Zurich Europe/Vaduz
726 In this example, the timezone is named Europe/Zurich but it has an alias
727 as Europe/Vaduz. This example says that Zurich was 34 minutes and 8
728 seconds east of UT until 1853-07-16 at 00:00, when the legal offset
730 .ds o 7 degrees 26 minutes 22.50 seconds
731 .if \n(.g .if c \(de .if c \(fm .if c \(sd .ds o 7\(de\|26\(fm\|22.50\(sd
733 which works out to 0:29:45.50;
735 treats this by rounding it to 0:29:46.
736 After 1894-06-01 at 00:00 the UT offset became one hour
737 and Swiss daylight saving rules (defined with lines beginning with
739 apply. From 1981 to the present, EU daylight saving rules have
740 applied, and the UTC offset has remained at one hour.
742 In 1941 and 1942, daylight saving time applied from the first Monday
743 in May at 01:00 to the first Monday in October at 02:00.
744 The pre-1981 EU daylight-saving rules have no effect
745 here, but are included for completeness. Since 1981, daylight
746 saving has begun on the last Sunday in March at 01:00 UTC.
747 Until 1995 it ended the last Sunday in September at 01:00 UTC,
748 but this changed to the last Sunday in October starting in 1996.
750 For purposes of display,
754 were initially used, respectively. Since
755 Swiss rules and later EU rules were applied, the time zone abbreviation
756 has been CET for standard time and CEST for daylight saving
761 Default local timezone file.
763 .I /usr/share/zoneinfo
764 Default timezone information directory.
766 For areas with more than two types of local time,
767 you may need to use local standard time in the
769 field of the earliest transition time's rule to ensure that
770 the earliest transition time recorded in the compiled file is correct.
773 for a particular timezone,
774 a clock advance caused by the start of daylight saving
775 coincides with and is equal to
776 a clock retreat caused by a change in UT offset,
778 produces a single transition to daylight saving at the new UT offset
779 without any change in local (wall clock) time.
780 To get separate transitions
781 use multiple zone continuation lines
782 specifying transition instants using universal time.
786 .\" This file is in the public domain, so clarified as of
787 .\" 2009-05-17 by Arthur David Olson.