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