1ZIC(8) Linux System Administration ZIC(8)
2
3
4
6 zic - timezone compiler
7
9 zic [ option ... ] [ filename ... ]
10
12 The zic program reads text from the file(s) named on the command line
13 and creates the time conversion information files specified in this in‐
14 put. If a filename is “-”, standard input is read.
15
17 --version
18 Output version information and exit.
19
20 --help Output short usage message and exit.
21
22 -b bloat
23 Output backward-compatibility data as specified by bloat. If
24 bloat is fat, generate additional data entries that work around
25 potential bugs or incompatibilities in older software, such as
26 software that mishandles the 64-bit generated data. If bloat is
27 slim, keep the output files small; this can help check for the
28 bugs and incompatibilities. Although the default is currently
29 fat, this is intended to change in future zic versions, as soft‐
30 ware that mishandles the 64-bit data typically mishandles time‐
31 stamps after the year 2038 anyway. Also see the -r option for
32 another way to shrink output size.
33
34 -d directory
35 Create time conversion information files in the named directory
36 rather than in the standard directory named below.
37
38 -l timezone
39 Use timezone as local time. zic will act as if the input con‐
40 tained a link line of the form
41
42 Link timezone localtime
43
44 -L leapsecondfilename
45 Read leap second information from the file with the given name.
46 If this option is not used, no leap second information appears
47 in output files.
48
49 -p timezone
50 Use timezone's rules when handling nonstandard TZ strings like
51 "EET-2EEST" that lack transition rules. zic will act as if the
52 input contained a link line of the form
53
54 Link timezone posixrules
55
56 This feature is obsolete and poorly supported. Among other
57 things it should not be used for timestamps after the year 2037,
58 and it should not be combined with -b slim if timezone's transi‐
59 tions are at standard time or Universal Time (UT) instead of lo‐
60 cal time.
61
62 -r [@lo][/@hi]
63 Reduce the size of output files by limiting their applicability
64 to timestamps in the range from lo (inclusive) to hi (exclu‐
65 sive), where lo and hi are possibly-signed decimal counts of
66 seconds since the Epoch (1970-01-01 00:00:00 UTC). Omitted
67 counts default to extreme values. For example, “zic -r @0”
68 omits data intended for negative timestamps (i.e., before the
69 Epoch), and “zic -r @0/@2147483648” outputs data intended only
70 for nonnegative timestamps that fit into 31-bit signed integers.
71 On platforms with GNU date, “zic -r @$(date +%s)” omits data in‐
72 tended for past timestamps. Also see the -b slim option for an‐
73 other way to shrink output size.
74
75 -t file
76 When creating local time information, put the configuration link
77 in the named file rather than in the standard location.
78
79 -v Be more verbose, and complain about the following situations:
80
81 The input specifies a link to a link.
82
83 A year that appears in a data file is outside the range of rep‐
84 resentable years.
85
86 A time of 24:00 or more appears in the input. Pre-1998 versions
87 of zic prohibit 24:00, and pre-2007 versions prohibit times
88 greater than 24:00.
89
90 A rule goes past the start or end of the month. Pre-2004 ver‐
91 sions of zic prohibit this.
92
93 A time zone abbreviation uses a %z format. Pre-2015 versions of
94 zic do not support this.
95
96 A timestamp contains fractional seconds. Pre-2018 versions of
97 zic do not support this.
98
99 The input contains abbreviations that are mishandled by pre-2018
100 versions of zic due to a longstanding coding bug. These abbre‐
101 viations include “L” for “Link”, “mi” for “min”, “Sa” for “Sat”,
102 and “Su” for “Sun”.
103
104 The output file does not contain all the information about the
105 long-term future of a timezone, because the future cannot be
106 summarized as an extended POSIX TZ string. For example, as of
107 2019 this problem occurs for Iran's daylight-saving rules for
108 the predicted future, as these rules are based on the Iranian
109 calendar, which cannot be represented.
110
111 The output contains data that may not be handled properly by
112 client code designed for older zic output formats. These com‐
113 patibility issues affect only timestamps before 1970 or after
114 the start of 2038.
115
116 The output file contains more than 1200 transitions, which may
117 be mishandled by some clients. The current reference client
118 supports at most 2000 transitions; pre-2014 versions of the ref‐
119 erence client support at most 1200 transitions.
120
121 A time zone abbreviation has fewer than 3 or more than 6 charac‐
122 ters. POSIX requires at least 3, and requires implementations
123 to support at least 6.
124
125 An output file name contains a byte that is not an ASCII letter,
126 “-”, “/”, or “_”; or it contains a file name component that con‐
127 tains more than 14 bytes or that starts with “-”.
128
130 Input files use the format described in this section; output files use
131 tzfile(5) format.
132
133 Input files should be text files, that is, they should be a series of
134 zero or more lines, each ending in a newline byte and containing at
135 most 511 bytes, and without any NUL bytes. The input text's encoding
136 is typically UTF-8 or ASCII; it should have a unibyte representation
137 for the POSIX Portable Character Set (PPCS) ⟨http://pubs.opengroup.org/
138 onlinepubs/9699919799/basedefs/V1_chap06.html⟩ and the encoding's non-
139 unibyte characters should consist entirely of non-PPCS bytes. Non-PPCS
140 characters typically occur only in comments: although output file names
141 and time zone abbreviations can contain nearly any character, other
142 software will work better if these are limited to the restricted syntax
143 described under the -v option.
144
145 Input lines are made up of fields. Fields are separated from one an‐
146 other by one or more white space characters. The white space charac‐
147 ters are space, form feed, carriage return, newline, tab, and vertical
148 tab. Leading and trailing white space on input lines is ignored. An
149 unquoted sharp character (#) in the input introduces a comment which
150 extends to the end of the line the sharp character appears on. White
151 space characters and sharp characters may be enclosed in double quotes
152 (") if they're to be used as part of a field. Any line that is blank
153 (after comment stripping) is ignored. Nonblank lines are expected to
154 be of one of three types: rule lines, zone lines, and link lines.
155
156 Names must be in English and are case insensitive. They appear in sev‐
157 eral contexts, and include month and weekday names and keywords such as
158 maximum, only, Rolling, and Zone. A name can be abbreviated by omit‐
159 ting all but an initial prefix; any abbreviation must be unambiguous in
160 context.
161
162 A rule line has the form
163
164 Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
165
166 For example:
167
168 Rule US 1967 1973 - Apr lastSun 2:00w 1:00d D
169
170 The fields that make up a rule line are:
171
172 NAME Gives the name of the rule set that contains this line. The
173 name must start with a character that is neither an ASCII digit
174 nor “-” nor “+”. To allow for future extensions, an unquoted
175 name should not contain characters from the set
176 “!$%&'()*,/:;<=>?@[\]^`{|}~”.
177
178 FROM Gives the first year in which the rule applies. Any signed in‐
179 teger year can be supplied; the proleptic Gregorian calendar is
180 assumed, with year 0 preceding year 1. The word minimum (or an
181 abbreviation) means the indefinite past. The word maximum (or
182 an abbreviation) means the indefinite future. Rules can de‐
183 scribe times that are not representable as time values, with
184 the unrepresentable times ignored; this allows rules to be por‐
185 table among hosts with differing time value types.
186
187 TO Gives the final year in which the rule applies. In addition to
188 minimum and maximum (as above), the word only (or an abbrevia‐
189 tion) may be used to repeat the value of the FROM field.
190
191 TYPE should be “-” and is present for compatibility with older ver‐
192 sions of zic in which it could contain year types.
193
194 IN Names the month in which the rule takes effect. Month names
195 may be abbreviated.
196
197 ON Gives the day on which the rule takes effect. Recognized forms
198 include:
199
200 5 the fifth of the month
201 lastSun the last Sunday in the month
202 lastMon the last Monday in the month
203 Sun>=8 first Sunday on or after the eighth
204 Sun<=25 last Sunday on or before the 25th
205
206 A weekday name (e.g., Sunday) or a weekday name preceded by
207 “last” (e.g., lastSunday) may be abbreviated or spelled out in
208 full. There must be no white space characters within the ON
209 field. The “<=” and “>=” constructs can result in a day in the
210 neighboring month; for example, the IN-ON combination “Oct
211 Sun>=31” stands for the first Sunday on or after October 31,
212 even if that Sunday occurs in November.
213
214 AT Gives the time of day at which the rule takes effect, relative
215 to 00:00, the start of a calendar day. Recognized forms in‐
216 clude:
217
218 2 time in hours
219 2:00 time in hours and minutes
220 01:28:14 time in hours, minutes, and seconds
221 00:19:32.13 time with fractional seconds
222 12:00 midday, 12 hours after 00:00
223 15:00 3 PM, 15 hours after 00:00
224 24:00 end of day, 24 hours after 00:00
225 260:00 260 hours after 00:00
226 -2:30 2.5 hours before 00:00
227 - equivalent to 0
228
229 Although zic rounds times to the nearest integer second (break‐
230 ing ties to the even integer), the fractions may be useful to
231 other applications requiring greater precision. The source
232 format does not specify any maximum precision. Any of these
233 forms may be followed by the letter w if the given time is lo‐
234 cal or “wall clock” time, s if the given time is standard time
235 without any adjustment for daylight saving, or u (or g or z) if
236 the given time is universal time; in the absence of an indica‐
237 tor, local (wall clock) time is assumed. These forms ignore
238 leap seconds; for example, if a leap second occurs at 00:59:60
239 local time, “1:00” stands for 3601 seconds after local midnight
240 instead of the usual 3600 seconds. The intent is that a rule
241 line describes the instants when a clock/calendar set to the
242 type of time specified in the AT field would show the specified
243 date and time of day.
244
245 SAVE Gives the amount of time to be added to local standard time
246 when the rule is in effect, and whether the resulting time is
247 standard or daylight saving. This field has the same format as
248 the AT field except with a different set of suffix letters: s
249 for standard time and d for daylight saving time. The suffix
250 letter is typically omitted, and defaults to s if the offset is
251 zero and to d otherwise. Negative offsets are allowed; in Ire‐
252 land, for example, daylight saving time is observed in winter
253 and has a negative offset relative to Irish Standard Time. The
254 offset is merely added to standard time; for example, zic does
255 not distinguish a 10:30 standard time plus an 0:30 SAVE from a
256 10:00 standard time plus a 1:00 SAVE.
257
258 LETTER/S
259 Gives the “variable part” (for example, the “S” or “D” in “EST”
260 or “EDT”) of time zone abbreviations to be used when this rule
261 is in effect. If this field is “-”, the variable part is null.
262
263 A zone line has the form
264
265 Zone NAME STDOFF RULES FORMAT [UNTIL]
266
267 For example:
268
269 Zone Asia/Amman 2:00 Jordan EE%sT 2017 Oct 27 01:00
270
271 The fields that make up a zone line are:
272
273 NAME The name of the timezone. This is the name used in creating the
274 time conversion information file for the timezone. It should not
275 contain a file name component “.” or “..”; a file name component
276 is a maximal substring that does not contain “/”.
277
278 STDOFF
279 The amount of time to add to UT to get standard time, without any
280 adjustment for daylight saving. This field has the same format
281 as the AT and SAVE fields of rule lines; begin the field with a
282 minus sign if time must be subtracted from UT.
283
284 RULES The name of the rules that apply in the timezone or, alterna‐
285 tively, a field in the same format as a rule-line SAVE column,
286 giving of the amount of time to be added to local standard time
287 effect, and whether the resulting time is standard or daylight
288 saving. If this field is - then standard time always applies.
289 When an amount of time is given, only the sum of standard time
290 and this amount matters.
291
292 FORMAT
293 The format for time zone abbreviations. The pair of characters
294 %s is used to show where the “variable part” of the time zone ab‐
295 breviation goes. Alternatively, a format can use the pair of
296 characters %z to stand for the UT offset in the form ±hh, ±hhmm,
297 or ±hhmmss, using the shortest form that does not lose informa‐
298 tion, where hh, mm, and ss are the hours, minutes, and seconds
299 east (+) or west (−) of UT. Alternatively, a slash (/) separates
300 standard and daylight abbreviations. To conform to POSIX, a time
301 zone abbreviation should contain only alphanumeric ASCII charac‐
302 ters, “+” and “-”.
303
304 UNTIL The time at which the UT offset or the rule(s) change for a loca‐
305 tion. It takes the form of one to four fields YEAR [MONTH [DAY
306 [TIME]]]. If this is specified, the time zone information is
307 generated from the given UT offset and rule change until the time
308 specified, which is interpreted using the rules in effect just
309 before the transition. The month, day, and time of day have the
310 same format as the IN, ON, and AT fields of a rule; trailing
311 fields can be omitted, and default to the earliest possible value
312 for the missing fields.
313
314 The next line must be a “continuation” line; this has the same
315 form as a zone line except that the string “Zone” and the name
316 are omitted, as the continuation line will place information
317 starting at the time specified as the “until” information in the
318 previous line in the file used by the previous line. Continua‐
319 tion lines may contain “until” information, just as zone lines
320 do, indicating that the next line is a further continuation.
321
322 If a zone changes at the same instant that a rule would otherwise take
323 effect in the earlier zone or continuation line, the rule is ignored.
324 A zone or continuation line L with a named rule set starts with stan‐
325 dard time by default: that is, any of L's timestamps preceding L's ear‐
326 liest rule use the rule in effect after L's first transition into stan‐
327 dard time. In a single zone it is an error if two rules take effect at
328 the same instant, or if two zone changes take effect at the same in‐
329 stant.
330
331 A link line has the form
332
333 Link TARGET LINK-NAME
334
335 For example:
336
337 Link Europe/Istanbul Asia/Istanbul
338
339 The TARGET field should appear as the NAME field in some zone line.
340 The LINK-NAME field is used as an alternative name for that zone; it
341 has the same syntax as a zone line's NAME field.
342
343 Except for continuation lines, lines may appear in any order in the in‐
344 put. However, the behavior is unspecified if multiple zone or link
345 lines define the same name, or if the source of one link line is the
346 target of another.
347
348 The file that describes leap seconds can have leap lines and an expira‐
349 tion line. Leap lines have the following form:
350
351 Leap YEAR MONTH DAY HH:MM:SS CORR R/S
352
353 For example:
354
355 Leap 2016 Dec 31 23:59:60 + S
356
357 The YEAR, MONTH, DAY, and HH:MM:SS fields tell when the leap second
358 happened. The CORR field should be “+” if a second was added or “-” if
359 a second was skipped. The R/S field should be (an abbreviation of)
360 “Stationary” if the leap second time given by the other fields should
361 be interpreted as UTC or (an abbreviation of) “Rolling” if the leap
362 second time given by the other fields should be interpreted as local
363 (wall clock) time.
364
365 The expiration line, if present, has the form:
366
367 Expires YEAR MONTH DAY HH:MM:SS
368
369 For example:
370
371 Expires 2020 Dec 28 00:00:00
372
373 The YEAR, MONTH, DAY, and HH:MM:SS fields give the expiration timestamp
374 in UTC for the leap second table; zic outputs this expiration timestamp
375 by truncating the end of the output file to the timestamp. If there is
376 no expiration line, zic also accepts a comment “#expires E ...” where E
377 is the expiration timestamp as a decimal integer count of seconds since
378 the Epoch, not counting leap seconds. However, the “#expires” comment
379 is an obsolescent feature, and the leap second file should use an expi‐
380 ration line instead of relying on a comment.
381
383 Here is an extended example of zic input, intended to illustrate many
384 of its features. In this example, the EU rules are for the European
385 Union and for its predecessor organization, the European Communities.
386
387 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
388 Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
389 Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
390 Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S
391 Rule EU 1977 only - Sep lastSun 1:00u 0 -
392 Rule EU 1978 only - Oct 1 1:00u 0 -
393 Rule EU 1979 1995 - Sep lastSun 1:00u 0 -
394 Rule EU 1981 max - Mar lastSun 1:00u 1:00 S
395 Rule EU 1996 max - Oct lastSun 1:00u 0 -
396
397 # Zone NAME STDOFF RULES FORMAT [UNTIL]
398 Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16
399 0:29:45.50 - BMT 1894 Jun
400 1:00 Swiss CE%sT 1981
401 1:00 EU CE%sT
402
403 Link Europe/Zurich Europe/Vaduz
404
405 In this example, the timezone is named Europe/Zurich but it has an
406 alias as Europe/Vaduz. This example says that Zurich was 34 minutes
407 and 8 seconds east of UT until 1853-07-16 at 00:00, when the legal off‐
408 set was changed to 7°26′22.50″, which works out to 0:29:45.50; zic
409 treats this by rounding it to 0:29:46. After 1894-06-01 at 00:00 the
410 UT offset became one hour and Swiss daylight saving rules (defined with
411 lines beginning with “Rule Swiss”) apply. From 1981 to the present, EU
412 daylight saving rules have applied, and the UTC offset has remained at
413 one hour.
414
415 In 1941 and 1942, daylight saving time applied from the first Monday in
416 May at 01:00 to the first Monday in October at 02:00. The pre-1981 EU
417 daylight-saving rules have no effect here, but are included for com‐
418 pleteness. Since 1981, daylight saving has begun on the last Sunday in
419 March at 01:00 UTC. Until 1995 it ended the last Sunday in September
420 at 01:00 UTC, but this changed to the last Sunday in October starting
421 in 1996.
422
423 For purposes of display, “LMT” and “BMT” were initially used, respec‐
424 tively. Since Swiss rules and later EU rules were applied, the time
425 zone abbreviation has been CET for standard time and CEST for daylight
426 saving time.
427
429 /etc/localtime
430 Default local timezone file.
431
432 /usr/share/zoneinfo
433 Default timezone information directory.
434
436 For areas with more than two types of local time, you may need to use
437 local standard time in the AT field of the earliest transition time's
438 rule to ensure that the earliest transition time recorded in the com‐
439 piled file is correct.
440
441 If, for a particular timezone, a clock advance caused by the start of
442 daylight saving coincides with and is equal to a clock retreat caused
443 by a change in UT offset, zic produces a single transition to daylight
444 saving at the new UT offset without any change in local (wall clock)
445 time. To get separate transitions use multiple zone continuation lines
446 specifying transition instants using universal time.
447
449 tzfile(5), zdump(8)
450
452 This page is part of release 5.13 of the Linux man-pages project. A
453 description of the project, information about reporting bugs, and the
454 latest version of this page, can be found at
455 https://www.kernel.org/doc/man-pages/.
456
457
458
459 2020-08-13 ZIC(8)