1 ZIC(8) System Manager's Manual ZIC(8)
4 zic - time zone compiler
7 zic [ option ... ] [ filename ... ]
10 Zic reads text from the file(s) named on the command line and creates
11 the time conversion information files specified in this input. If a
12 filename is "-", the standard input is read.
14 These options are available:
17 Output version information and exit.
20 Create time conversion information files in the named directory
21 rather than in the standard directory named below.
24 Use the given time zone as local time. Zic will act as if the
25 input contained a link line of the form
27 Link timezone localtime
30 Use the given time zone's rules when handling POSIX-format time
31 zone environment variables. Zic will act as if the input
32 contained a link line of the form
34 Link timezone posixrules
37 Read leap second information from the file with the given name.
38 If this option is not used, no leap second information appears
41 -v Be more verbose, and complain about the following situations:
43 The input specifies a link to a link.
45 A year that appears in a data file is outside the range of years
46 representable by time(2) values.
48 A time of 24:00 or more appears in the input. Pre-1998 versions
49 of zic prohibit 24:00, and pre-2007 versions prohibit times
52 A rule goes past the start or end of the month. Pre-2004
53 versions of zic prohibit this.
55 The output file does not contain all the information about the
56 long-term future of a zone, because the future cannot be
57 summarized as an extended POSIX TZ string. For example, as of
58 2013 this problem occurs for Iran's daylight-saving rules for
59 the predicted future, as these rules are based on the Iranian
60 calendar, which cannot be represented.
62 The output contains data that may not be handled properly by
63 client code designed for older zic output formats. These
64 compatibility issues affect only time stamps before 1970 or
65 after the start of 2038.
67 A time zone abbreviation has fewer than 3 characters. POSIX
70 An output file name contains a byte that is not an ASCII letter,
71 "-", "/", or "_"; or it contains a file name component that
72 contains more than 14 bytes or that starts with "-".
74 -s Limit time values stored in output files to values that are the
75 same whether they're taken to be signed or unsigned. You can
76 use this option to generate SVVS-compatible files.
78 Input files should be text files, that is, they should be a series of
79 zero or more lines, each ending in a newline byte and containing at
80 most 511 bytes, and without any NUL bytes. The input text's encoding
81 is typically UTF-8 or ASCII; it should have a unibyte representation
82 for the POSIX Portable Character Set (PPCS) <http://pubs.opengroup.org/
83 onlinepubs/9699919799/basedefs/V1_chap06.html> and the encoding's non-
84 unibyte characters should consist entirely of non-PPCS bytes. Non-PPCS
85 characters typically occur only in comments: although output file names
86 and time zone abbreviations can contain nearly any character, other
87 software will work better if these are limited to the restricted syntax
88 described under the -v option.
90 Input lines are made up of fields. Fields are separated from one
91 another by one or more white space characters. The white space
92 characters are space, form feed, carriage return, newline, tab, and
93 vertical tab. Leading and trailing white space on input lines is
94 ignored. An unquoted sharp character (#) in the input introduces a
95 comment which extends to the end of the line the sharp character
96 appears on. White space characters and sharp characters may be
97 enclosed in double quotes (") if they're to be used as part of a field.
98 Any line that is blank (after comment stripping) is ignored. Non-blank
99 lines are expected to be of one of three types: rule lines, zone lines,
102 Names (such as month names) must be in English and are case
103 insensitive. Abbreviations, if used, must be unambiguous in context.
105 A rule line has the form
107 Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
111 Rule US 1967 1973 - Apr lastSun 2:00 1:00 D
113 The fields that make up a rule line are:
115 NAME Gives the (arbitrary) name of the set of rules this rule is
118 FROM Gives the first year in which the rule applies. Any integer
119 year can be supplied; the proleptic Gregorian calendar is
120 assumed. The word minimum (or an abbreviation) means the
121 minimum year representable as an integer. The word maximum (or
122 an abbreviation) means the maximum year representable as an
123 integer. Rules can describe times that are not representable
124 as time values, with the unrepresentable times ignored; this
125 allows rules to be portable among hosts with differing time
128 TO Gives the final year in which the rule applies. In addition to
129 minimum and maximum (as above), the word only (or an
130 abbreviation) may be used to repeat the value of the FROM
133 TYPE should be "-" and is present for compatibility with older
134 versions of zic in which it could contain year types.
136 IN Names the month in which the rule takes effect. Month names
139 ON Gives the day on which the rule takes effect. Recognized forms
142 5 the fifth of the month
143 lastSun the last Sunday in the month
144 lastMon the last Monday in the month
145 Sun>=8 first Sunday on or after the eighth
146 Sun<=25 last Sunday on or before the 25th
148 Names of days of the week may be abbreviated or spelled out in
149 full. Note that there must be no spaces within the ON field.
151 AT Gives the time of day at which the rule takes effect.
152 Recognized forms include:
155 2:00 time in hours and minutes
156 15:00 24-hour format time (for times after noon)
157 1:28:14 time in hours, minutes, and seconds
160 where hour 0 is midnight at the start of the day, and hour 24
161 is midnight at the end of the day. Any of these forms may be
162 followed by the letter w if the given time is local "wall
163 clock" time, s if the given time is local "standard" time, or u
164 (or g or z) if the given time is universal time; in the absence
165 of an indicator, wall clock time is assumed. The intent is
166 that a rule line describes the instants when a clock/calendar
167 set to the type of time specified in the AT field would show
168 the specified date and time of day.
170 SAVE Gives the amount of time to be added to local standard time
171 when the rule is in effect. This field has the same format as
172 the AT field (although, of course, the w and s suffixes are not
173 used). Only the sum of standard time and this amount matters;
174 for example, zic does not distinguish a 10:30 standard time
175 plus an 0:30 SAVE from a 10:00 standard time plus a 1:00 SAVE.
178 Gives the "variable part" (for example, the "S" or "D" in "EST"
179 or "EDT") of time zone abbreviations to be used when this rule
180 is in effect. If this field is "-", the variable part is null.
182 A zone line has the form
184 Zone NAME GMTOFF RULES/SAVE FORMAT [UNTILYEAR [MONTH [DAY [TIME]]]]
188 Zone Australia/Adelaide 9:30 Aus AC%sT 1971 Oct 31 2:00
190 The fields that make up a zone line are:
192 NAME The name of the time zone. This is the name used in creating the
193 time conversion information file for the zone. It should not
194 contain a file name component "." or ".."; a file name component
195 is a maximal substring that does not contain "/".
198 The amount of time to add to UT to get standard time in this
199 zone. This field has the same format as the AT and SAVE fields
200 of rule lines; begin the field with a minus sign if time must be
204 The name of the rule(s) that apply in the time zone or,
205 alternately, an amount of time to add to local standard time. If
206 this field is - then standard time always applies in the time
207 zone. When an amount of time is given, only the sum of standard
208 time and this amount matters.
211 The format for time zone abbreviations in this time zone. The
212 pair of characters %s is used to show where the "variable part"
213 of the time zone abbreviation goes. Alternately, a format can
214 use the pair of characters %z to stand for the UTC offset in the
215 form +-hh, +-hhmm, or +-hhmmss, using the shortest form that does
216 not lose information, where hh, mm, and ss are the hours,
217 minutes, and seconds east (+) or west (-) of UTC. Alternately, a
218 slash (/) separates standard and daylight abbreviations. To
219 conform to POSIX, a time zone abbreviation should contain only
220 alphanumeric ASCII characters, "+" and "-".
222 UNTILYEAR [MONTH [DAY [TIME]]]
223 The time at which the UT offset or the rule(s) change for a
224 location. It is specified as a year, a month, a day, and a time
225 of day. If this is specified, the time zone information is
226 generated from the given UT offset and rule change until the time
227 specified, which is interpreted using the rules in effect just
228 before the transition. The month, day, and time of day have the
229 same format as the IN, ON, and AT fields of a rule; trailing
230 fields can be omitted, and default to the earliest possible value
231 for the missing fields.
233 The next line must be a "continuation" line; this has the same
234 form as a zone line except that the string "Zone" and the name
235 are omitted, as the continuation line will place information
236 starting at the time specified as the "until" information in the
237 previous line in the file used by the previous line.
238 Continuation lines may contain "until" information, just as zone
239 lines do, indicating that the next line is a further
242 If a zone changes at the same instant that a rule would otherwise take
243 effect in the earlier zone or continuation line, the rule is ignored.
244 In a single zone it is an error if two rules take effect at the same
245 instant, or if two zone changes take effect at the same instant.
247 A link line has the form
249 Link TARGET LINK-NAME
253 Link Europe/Istanbul Asia/Istanbul
255 The TARGET field should appear as the NAME field in some zone line.
256 The LINK-NAME field is used as an alternate name for that zone; it has
257 the same syntax as a zone line's NAME field.
259 Except for continuation lines, lines may appear in any order in the
260 input. However, the behavior is unspecified if multiple zone or link
261 lines define the same name, or if the source of one link line is the
264 Lines in the file that describes leap seconds have the following form:
266 Leap YEAR MONTH DAY HH:MM:SS CORR R/S
270 Leap 1974 Dec 31 23:59:60 + S
272 The YEAR, MONTH, DAY, and HH:MM:SS fields tell when the leap second
273 happened. The CORR field should be "+" if a second was added or "-" if
274 a second was skipped. The R/S field should be (an abbreviation of)
275 "Stationary" if the leap second time given by the other fields should
276 be interpreted as UTC or (an abbreviation of) "Rolling" if the leap
277 second time given by the other fields should be interpreted as local
281 Here is an extended example of zic input, intended to illustrate many
284 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
285 Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
286 Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
287 Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S
288 Rule EU 1977 only - Sep lastSun 1:00u 0 -
289 Rule EU 1978 only - Oct 1 1:00u 0 -
290 Rule EU 1979 1995 - Sep lastSun 1:00u 0 -
291 Rule EU 1981 max - Mar lastSun 1:00u 1:00 S
292 Rule EU 1996 max - Oct lastSun 1:00u 0 -
294 # Zone NAME GMTOFF RULES/SAVE FORMAT UNTIL
295 Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16
296 0:29:46 - BMT 1894 Jun
297 1:00 Swiss CE%sT 1981
300 Link Europe/Zurich Switzerland
302 In this example, the zone is named Europe/Zurich but it has an alias as
303 Switzerland. This example says that Zurich was 34 minutes and 8
304 seconds west of UT until 1853-07-16 at 00:00, when the legal offset was
305 changed to 7o26'22.50''; although this works out to 0:29:45.50, the
306 input format cannot represent fractional seconds so it is rounded here.
307 After 1894-06-01 at 00:00 Swiss daylight saving rules (defined with
308 lines beginning with "Rule Swiss") apply, and the UT offset became one
309 hour. From 1981 to the present, EU daylight saving rules have applied,
310 and the UTC offset has remained at one hour.
312 In 1941 and 1942, daylight saving time applied from the first Monday in
313 May at 01:00 to the first Monday in October at 02:00. The pre-1981 EU
314 daylight-saving rules have no effect here, but are included for
315 completeness. Since 1981, daylight saving has begun on the last Sunday
316 in March at 01:00 UTC. Until 1995 it ended the last Sunday in
317 September at 01:00 UTC, but this changed to the last Sunday in October
320 For purposes of display, "LMT" and "BMT" were initially used,
321 respectively. Since Swiss rules and later EU rules were applied, the
322 display name for the time zone has been CET for standard time and CEST
323 for daylight saving time.
326 For areas with more than two types of local time, you may need to use
327 local standard time in the AT field of the earliest transition time's
328 rule to ensure that the earliest transition time recorded in the
329 compiled file is correct.
331 If, for a particular zone, a clock advance caused by the start of
332 daylight saving coincides with and is equal to a clock retreat caused
333 by a change in UT offset, zic produces a single transition to daylight
334 saving at the new UT offset (without any change in wall clock time).
335 To get separate transitions use multiple zone continuation lines
336 specifying transition instants using universal time.
338 Time stamps well before the Big Bang are silently omitted from the
339 output. This works around bugs in software that mishandles large
340 negative time stamps. Call it sour grapes, but pre-Big-Bang time
341 stamps are physically suspect anyway. The pre-Big-Bang cutoff time is
342 approximate and may change in future versions.
345 /usr/local/etc/zoneinfo standard directory used for created
349 newctime(3), tzfile(5), zdump(8)