]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man8/zic.8
pipe.2: Note that 'pipefd' is left unchanged in the event of an error
[thirdparty/man-pages.git] / man8 / zic.8
CommitLineData
2d6c6dd1 1.\" %%%LICENSE_START(PUBLIC_DOMAIN)
c3d92f8a 2.\" This page is in the public domain
2d6c6dd1 3.\" %%%LICENSE_END
c3d92f8a 4.\"
9ba01802 5.TH ZIC 8 2019-03-06 "" "Linux System Administration"
fea681da 6.SH NAME
5b0dc1ba 7zic \- timezone compiler
fea681da 8.SH SYNOPSIS
5355e20f
PE
9.B zic
10[
11.I option
12\&... ] [
13.I filename
14\&... ]
fea681da 15.SH DESCRIPTION
5355e20f
PE
16.ie '\(lq'' .ds lq \&"\"
17.el .ds lq \(lq\"
18.ie '\(rq'' .ds rq \&"\"
19.el .ds rq \(rq\"
fea681da
MK
20.de q
21\\$3\*(lq\\$1\*(rq\\$2
22..
5355e20f
PE
23.ie '\(la'' .ds < <
24.el .ds < \(la
25.ie '\(ra'' .ds > >
26.el .ds > \(ra
27.ie \n(.g \{\
28. ds : \:
29. ds - \f(CW-\fP
30.\}
31.el \{\
32. ds :
33. ds - \-
34.\}
fff3db33
MK
35The
36.B zic
37program reads text from the file(s) named on the command line
fea681da
MK
38and creates the time conversion information files specified in this input.
39If a
40.I filename
41is
5355e20f 42.q "\*-" ,
02af2073 43standard input is read.
5355e20f 44.SH OPTIONS
fea681da 45.TP
5355e20f
PE
46.B "\*-\*-version"
47Output version information and exit.
48.TP
49.B \*-\*-help
50Output short usage message and exit.
51.TP
52.BI "\*-d " directory
fea681da
MK
53Create time conversion information files in the named directory rather than
54in the standard directory named below.
55.TP
5355e20f
PE
56.BI "\*-l " timezone
57Use
58.I timezone
59as local time.
fff3db33 60.B zic
fea681da 61will act as if the input contained a link line of the form
5355e20f 62.sp
fea681da
MK
63.ti +.5i
64Link \fItimezone\fP localtime
65.TP
5355e20f
PE
66.BI "\*-p " timezone
67Use
68.IR timezone 's
69rules when handling POSIX-format
5b0dc1ba 70timezone environment variables.
fff3db33 71.B zic
fea681da 72will act as if the input contained a link line of the form
5355e20f 73.sp
fea681da
MK
74.ti +.5i
75Link \fItimezone\fP posixrules
76.TP
5355e20f 77.BI "\*-L " leapsecondfilename
fea681da
MK
78Read leap second information from the file with the given name.
79If this option is not used,
80no leap second information appears in output files.
81.TP
5355e20f
PE
82.B \*-v
83Be more verbose, and complain about the following situations:
84.RS
85.PP
86The input specifies a link to a link.
87.PP
88A year that appears in a data file is outside the range
fea681da 89of years representable by
e6b40d46 90.BR time (2)
fea681da 91values.
5355e20f
PE
92.PP
93A time of 24:00 or more appears in the input.
94Pre-1998 versions of
95.B zic
96prohibit 24:00, and pre-2007 versions prohibit times greater than 24:00.
97.PP
98A rule goes past the start or end of the month.
99Pre-2004 versions of
100.B zic
101prohibit this.
102.PP
103The output file does not contain all the information about the
104long-term future of a timezone, because the future cannot be summarized as
105an extended POSIX TZ string. For example, as of 2013 this problem
106occurs for Iran's daylight-saving rules for the predicted future, as
107these rules are based on the Iranian calendar, which cannot be
108represented.
109.PP
110The output contains data that may not be handled properly by client
111code designed for older
112.B zic
113output formats. These compatibility issues affect only timestamps
114before 1970 or after the start of 2038.
115.PP
116A time zone abbreviation has fewer than 3 characters.
117POSIX requires at least 3.
118.PP
119An output file name contains a byte that is not an ASCII letter,
120.q "\*-" ,
121.q "/" ,
122or
123.q "_" ;
124or it contains a file name component that contains more than 14 bytes
125or that starts with
126.q "\*-" .
127.RE
fea681da 128.TP
5355e20f 129.B \*-s
fea681da
MK
130Limit time values stored in output files to values that are the same
131whether they're taken to be signed or unsigned.
132You can use this option to generate SVVS-compatible files.
5355e20f
PE
133.PP
134Input files should be text files, that is, they should be a series of
135zero or more lines, each ending in a newline byte and containing at
136most 511 bytes, and without any NUL bytes. The input text's encoding
137is typically UTF-8 or ASCII; it should have a unibyte representation
138for the POSIX Portable Character Set (PPCS)
139\*<http://pubs\*:.opengroup\*:.org/\*:onlinepubs/\*:9699919799/\*:basedefs/\*:V1_chap06\*:.html\*>
140and the encoding's non-unibyte characters should consist entirely of
141non-PPCS bytes. Non-PPCS characters typically occur only in comments:
142although output file names and time zone abbreviations can contain
143nearly any character, other software will work better if these are
144limited to the restricted syntax described under the
145.B \*-v
146option.
fea681da
MK
147.PP
148Input lines are made up of fields.
5355e20f
PE
149Fields are separated from one another by one or more white space characters.
150The white space characters are space, form feed, carriage return, newline,
151tab, and vertical tab.
fea681da
MK
152Leading and trailing white space on input lines is ignored.
153An unquoted sharp character (#) in the input introduces a comment which extends
154to the end of the line the sharp character appears on.
155White space characters and sharp characters may be enclosed in double quotes
156(") if they're to be used as part of a field.
157Any line that is blank (after comment stripping) is ignored.
44732c9c 158Nonblank lines are expected to be of one of three types:
fea681da
MK
159rule lines, zone lines, and link lines.
160.PP
5355e20f
PE
161Names must be in English and are case insensitive.
162They appear in several contexts, and include month and weekday names
163and keywords such as
164.BR "maximum" ,
165.BR "only" ,
166.BR "Rolling" ,
167and
168.BR "Zone" .
169A name can be abbreviated by omitting all but an initial prefix; any
170abbreviation must be unambiguous in context.
171.PP
fea681da
MK
172A rule line has the form
173.nf
174.ti +.5i
5355e20f
PE
175.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
176.sp
fea681da 177Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
5355e20f 178.sp
fea681da
MK
179For example:
180.ti +.5i
5355e20f
PE
181.sp
182Rule US 1967 1973 \*- Apr lastSun 2:00w 1:00 D
183.sp
fea681da
MK
184.fi
185The fields that make up a rule line are:
186.TP "\w'LETTER/S'u"
187.B NAME
5355e20f
PE
188Gives the name of the rule set that contains this line.
189The name must start with a character that is neither
190an ASCII digit nor
191.q \*-
192nor
193.q + .
194To allow for future extensions,
195an unquoted name should not contain characters from the set
196.q !$%&'()*,/:;<=>?@[\e]^`{|}~ .
fea681da
MK
197.TP
198.B FROM
199Gives the first year in which the rule applies.
5355e20f
PE
200Any signed integer year can be supplied; the proleptic Gregorian calendar
201is assumed, with year 0 preceding year 1.
fea681da 202The word
5355e20f
PE
203.B minimum
204(or an abbreviation) means the indefinite past.
fea681da 205The word
5355e20f
PE
206.B maximum
207(or an abbreviation) means the indefinite future.
fea681da
MK
208Rules can describe times that are not representable as time values,
209with the unrepresentable times ignored; this allows rules to be portable
210among hosts with differing time value types.
211.TP
212.B TO
213Gives the final year in which the rule applies.
214In addition to
5355e20f 215.B minimum
fea681da 216and
5355e20f 217.B maximum
fea681da
MK
218(as above),
219the word
5355e20f 220.B only
fea681da
MK
221(or an abbreviation)
222may be used to repeat the value of the
223.B FROM
224field.
225.TP
226.B TYPE
5355e20f
PE
227should be
228.q \*-
229and is present for compatibility with older versions of
230.B zic
231in which it could contain year types.
fea681da
MK
232.TP
233.B IN
234Names the month in which the rule takes effect.
235Month names may be abbreviated.
236.TP
237.B ON
238Gives the day on which the rule takes effect.
239Recognized forms include:
240.nf
241.in +.5i
5355e20f 242.sp
fea681da
MK
243.ta \w'Sun<=25\0\0'u
2445 the fifth of the month
245lastSun the last Sunday in the month
246lastMon the last Monday in the month
247Sun>=8 first Sunday on or after the eighth
248Sun<=25 last Sunday on or before the 25th
249.fi
250.in -.5i
5355e20f
PE
251.sp
252A weekday name (e.g.,
253.BR "Sunday" )
254or a weekday name preceded by
255.q "last"
256(e.g.,
257.BR "lastSunday" )
258may be abbreviated or spelled out in full.
fea681da
MK
259Note that there must be no spaces within the
260.B ON
261field.
262.TP
263.B AT
264Gives the time of day at which the rule takes effect.
265Recognized forms include:
266.nf
267.in +.5i
5355e20f
PE
268.sp
269.ta \w'00:19:32.13\0\0'u
fea681da
MK
2702 time in hours
2712:00 time in hours and minutes
5355e20f 27201:28:14 time in hours, minutes, and seconds
fea681da 27315:00 24-hour format time (for times after noon)
5355e20f
PE
274260:00 260 hours after 00:00
275\*-2:30 2.5 hours before 00:00
276\*- equivalent to 0
fea681da
MK
277.fi
278.in -.5i
5355e20f 279.sp
fea681da
MK
280where hour 0 is midnight at the start of the day,
281and hour 24 is midnight at the end of the day.
282Any of these forms may be followed by the letter
5355e20f 283.B w
fea681da
MK
284if the given time is local
285.q "wall clock"
286time,
5355e20f 287.B s
fea681da 288if the given time is local
5355e20f 289.q "standard"
fea681da 290time, or
5355e20f 291.B u
fea681da 292(or
5355e20f 293.B g
fea681da 294or
5355e20f 295.BR z )
fea681da
MK
296if the given time is universal time;
297in the absence of an indicator,
298wall clock time is assumed.
5355e20f
PE
299The intent is that a rule line describes the instants when a
300clock/calendar set to the type of time specified in the
301.B AT
302field would show the specified date and time of day.
fea681da
MK
303.TP
304.B SAVE
305Gives the amount of time to be added to local standard time when the rule is in
306effect.
307This field has the same format as the
308.B AT
309field
310(although, of course, the
5355e20f 311.B w
fea681da 312and
5355e20f 313.B s
fea681da 314suffixes are not used).
5355e20f
PE
315Negative offsets are allowed; in Ireland, for example, daylight saving
316time is observed in winter and has a negative offset relative to
317Irish Standard Time.
318The offset is merely added to standard time; for example,
319.B zic
320does not distinguish a 10:30 standard time plus an 0:30
321.B SAVE
322from a 10:00 standard time plus a 1:00
323.BR SAVE .
fea681da
MK
324.TP
325.B LETTER/S
326Gives the
327.q "variable part"
328(for example, the
5355e20f 329.q "S"
fea681da 330or
5355e20f 331.q "D"
fea681da 332in
5355e20f 333.q "EST"
fea681da 334or
5355e20f
PE
335.q "EDT" )
336of time zone abbreviations to be used when this rule is in effect.
fea681da 337If this field is
5355e20f 338.q \*- ,
fea681da
MK
339the variable part is null.
340.PP
341A zone line has the form
5355e20f 342.sp
fea681da
MK
343.nf
344.ti +.5i
5355e20f
PE
345.ta \w'Zone\0\0'u +\w'Asia/Amman\0\0'u +\w'UTOFF\0\0'u +\w'Jordan\0\0'u +\w'FORMAT\0\0'u
346Zone NAME UTOFF RULES FORMAT [UNTIL]
347.sp
fea681da 348For example:
5355e20f 349.sp
fea681da 350.ti +.5i
5355e20f
PE
351Zone Asia/Amman 2:00 Jordan EE%sT 2017 Oct 27 01:00
352.sp
fea681da
MK
353.fi
354The fields that make up a zone line are:
5355e20f 355.TP "\w'UTOFF'u"
fea681da 356.B NAME
5b0dc1ba 357The name of the timezone.
fea681da 358This is the name used in creating the time conversion information file for the
5355e20f
PE
359timezone.
360It should not contain a file name component
361.q ".\&"
362or
363.q ".." ;
364a file name component is a maximal substring that does not contain
365.q "/" .
fea681da 366.TP
5355e20f
PE
367.B UTOFF
368The amount of time to add to UT to get standard time.
fea681da
MK
369This field has the same format as the
370.B AT
371and
372.B SAVE
373fields of rule lines;
5355e20f 374begin the field with a minus sign if time must be subtracted from UT.
fea681da 375.TP
5355e20f
PE
376.B RULES
377The name of the rules that apply in the timezone or,
378alternatively, a field in the same format as a rule-line SAVE column,
379giving of the amount of time to be added to local standard time
380effect, and whether the resulting time is standard or daylight saving.
fea681da 381If this field is
5355e20f
PE
382.B \*-
383then standard time always applies.
384When an amount of time is given, only the sum of standard time and
385this amount matters.
fea681da
MK
386.TP
387.B FORMAT
5355e20f 388The format for time zone abbreviations.
fea681da
MK
389The pair of characters
390.B %s
391is used to show where the
392.q "variable part"
5355e20f
PE
393of the time zone abbreviation goes.
394Alternatively, a format can use the pair of characters
395.B %z
396to stand for the UT offset in the form
397.RI \(+- hh ,
398.RI \(+- hhmm ,
399or
400.RI \(+- hhmmss ,
401using the shortest form that does not lose information, where
402.IR hh ,
403.IR mm ,
404and
405.I ss
406are the hours, minutes, and seconds east (+) or west (\(mi) of UT.
407Alternatively,
fea681da
MK
408a slash (/)
409separates standard and daylight abbreviations.
5355e20f
PE
410To conform to POSIX, a time zone abbreviation should contain only
411alphanumeric ASCII characters,
412.q "+"
413and
414.q "\*-".
fea681da
MK
415.TP
416.B UNTIL
5355e20f
PE
417The time at which the UT offset or the rule(s) change for a location.
418It takes the form of YEAR [MONTH [DAY [TIME]]].
fea681da 419If this is specified,
5355e20f
PE
420the time zone information is generated from the given UT offset
421and rule change until the time specified, which is interpreted using
422the rules in effect just before the transition.
fea681da 423The month, day, and time of day have the same format as the IN, ON, and AT
5355e20f
PE
424fields of a rule; trailing fields can be omitted, and default to the
425earliest possible value for the missing fields.
fea681da
MK
426.IP
427The next line must be a
5355e20f 428.q "continuation"
fea681da
MK
429line; this has the same form as a zone line except that the
430string
5355e20f 431.q "Zone"
fea681da
MK
432and the name are omitted, as the continuation line will
433place information starting at the time specified as the
5355e20f
PE
434.q "until"
435information in the previous line in the file used by the previous line.
436Continuation lines may contain
437.q "until"
438information, just as zone lines do, indicating that the next line is a further
fea681da
MK
439continuation.
440.PP
5355e20f
PE
441If a zone changes at the same instant that a rule would otherwise take
442effect in the earlier zone or continuation line, the rule is ignored.
443In a single zone it is an error if two rules take effect at the same
444instant, or if two zone changes take effect at the same instant.
51f5698d 445.PP
5355e20f
PE
446A link line has the form
447.sp
fea681da
MK
448.nf
449.ti +.5i
450.ta \w'Link\0\0'u +\w'Europe/Istanbul\0\0'u
5355e20f
PE
451Link TARGET LINK-NAME
452.sp
fea681da 453For example:
5355e20f 454.sp
fea681da
MK
455.ti +.5i
456Link Europe/Istanbul Asia/Istanbul
5355e20f 457.sp
fea681da
MK
458.fi
459The
5355e20f 460.B TARGET
fea681da
MK
461field should appear as the
462.B NAME
5355e20f
PE
463field in some zone line.
464The
465.B LINK-NAME
466field is used as an alternative name for that zone;
467it has the same syntax as a zone line's
468.B NAME
469field.
fea681da
MK
470.PP
471Except for continuation lines,
472lines may appear in any order in the input.
5355e20f
PE
473However, the behavior is unspecified if multiple zone or link lines
474define the same name, or if the source of one link line is the target
475of another.
fea681da
MK
476.PP
477Lines in the file that describes leap seconds have the following form:
478.nf
479.ti +.5i
480.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
5355e20f 481.sp
fea681da 482Leap YEAR MONTH DAY HH:MM:SS CORR R/S
5355e20f 483.sp
fea681da
MK
484For example:
485.ti +.5i
5355e20f
PE
486.sp
487Leap 2016 Dec 31 23:59:60 + S
488.sp
fea681da
MK
489.fi
490The
491.BR YEAR ,
492.BR MONTH ,
493.BR DAY ,
494and
495.B HH:MM:SS
496fields tell when the leap second happened.
497The
498.B CORR
499field
500should be
5355e20f 501.q "+"
fea681da
MK
502if a second was added
503or
5355e20f 504.q "\*-"
fea681da 505if a second was skipped.
fea681da
MK
506The
507.B R/S
508field
509should be (an abbreviation of)
5355e20f 510.q "Stationary"
fea681da
MK
511if the leap second time given by the other fields should be interpreted as UTC
512or
513(an abbreviation of)
5355e20f 514.q "Rolling"
fea681da
MK
515if the leap second time given by the other fields should be interpreted as
516local wall clock time.
5355e20f
PE
517.SH "EXTENDED EXAMPLE"
518Here is an extended example of
519.B zic
520input, intended to illustrate many of its features.
521In this example, the EU rules are for the European Union
522and for its predecessor organization, the European Communities.
523.br
524.ne 22
525.nf
526.in +2m
527.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
528.sp
529# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
530Rule Swiss 1941 1942 \*- May Mon>=1 1:00 1:00 S
531Rule Swiss 1941 1942 \*- Oct Mon>=1 2:00 0 \*-
532.sp .5
533Rule EU 1977 1980 \*- Apr Sun>=1 1:00u 1:00 S
534Rule EU 1977 only \*- Sep lastSun 1:00u 0 \*-
535Rule EU 1978 only \*- Oct 1 1:00u 0 \*-
536Rule EU 1979 1995 \*- Sep lastSun 1:00u 0 \*-
537Rule EU 1981 max \*- Mar lastSun 1:00u 1:00 S
538Rule EU 1996 max \*- Oct lastSun 1:00u 0 \*-
539.sp
540.ta \w'# Zone\0\0'u +\w'Europe/Zurich\0\0'u +\w'0:34:08\0\0'u +\w'RULES\0\0'u +\w'FORMAT\0\0'u
541# Zone NAME UTOFF RULES FORMAT [UNTIL]
542Zone Europe/Zurich 0:34:08 \*- LMT 1853 Jul 16
543 0:29:46 \*- BMT 1894 Jun
544 1:00 Swiss CE%sT 1981
545 1:00 EU CE%sT
546.sp
547Link Europe/Zurich Europe/Vaduz
548.sp
549.in
550.fi
551In this example, the timezone is named Europe/Zurich but it has an alias
552as Europe/Vaduz. This example says that Zurich was 34 minutes and 8
553seconds east of UT until 1853-07-16 at 00:00, when the legal offset
554was changed to 7\(de\|26\(fm\|22.50\(sd; although this works out to
5550:29:45.50, the input format cannot represent fractional seconds so it
556is rounded here. After 1894-06-01 at 00:00 the UT offset became one hour
557and Swiss daylight saving rules (defined with lines beginning with
558.q "Rule Swiss")
559apply. From 1981 to the present, EU daylight saving rules have
560applied, and the UTC offset has remained at one hour.
561.PP
562In 1941 and 1942, daylight saving time applied from the first Monday
563in May at 01:00 to the first Monday in October at 02:00.
564The pre-1981 EU daylight-saving rules have no effect
565here, but are included for completeness. Since 1981, daylight
566saving has begun on the last Sunday in March at 01:00 UTC.
567Until 1995 it ended the last Sunday in September at 01:00 UTC,
568but this changed to the last Sunday in October starting in 1996.
569.PP
570For purposes of display,
571.q "LMT"
572and
573.q "BMT"
574were initially used, respectively. Since
575Swiss rules and later EU rules were applied, the time zone abbreviation
576has been CET for standard time and CEST for daylight saving
577time.
2b2581ee 578.SH FILES
ef43b7cd 579.TP
5355e20f
PE
580.I /etc/localtime
581Default local timezone file.
582.TP
583.I /usr/share/zoneinfo
584Default timezone information directory.
19c98696 585.SH NOTES
fea681da
MK
586For areas with more than two types of local time,
587you may need to use local standard time in the
588.B AT
589field of the earliest transition time's rule to ensure that
590the earliest transition time recorded in the compiled file is correct.
5355e20f
PE
591.PP
592If,
593for a particular timezone,
594a clock advance caused by the start of daylight saving
595coincides with and is equal to
596a clock retreat caused by a change in UT offset,
597.B zic
598produces a single transition to daylight saving at the new UT offset
599(without any change in wall clock time).
600To get separate transitions
601use multiple zone continuation lines
602specifying transition instants using universal time.
47297adb 603.SH SEE ALSO
ad4fa959
MK
604.BR tzfile (5),
605.BR zdump (8)
5355e20f
PE
606.\" This file is in the public domain, so clarified as of
607.\" 2009-05-17 by Arthur David Olson.