logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Description

       The  zic  program  reads  text  from  the  file(s)  named  on  the  command line and creates the timezone
       information format (TZif) files specified in this input.  If a filename is “-”, standard input is read.

Extended Example

       Here is an extended example of zic input, intended to illustrate many of its features.

         # Rule  NAME  FROM  TO    -  IN   ON       AT    SAVE  LETTER/S
         Rule    Swiss 1941  1942  -  May  Mon>=1   1:00  1:00  S
         Rule    Swiss 1941  1942  -  Oct  Mon>=1   2:00  0     -
         Rule    EU    1977  1980  -  Apr  Sun>=1   1:00u 1:00  S
         Rule    EU    1977  only  -  Sep  lastSun  1:00u 0     -
         Rule    EU    1978  only  -  Oct   1       1:00u 0     -
         Rule    EU    1979  1995  -  Sep  lastSun  1:00u 0     -
         Rule    EU    1981  max   -  Mar  lastSun  1:00u 1:00  S
         Rule    EU    1996  max   -  Oct  lastSun  1:00u 0     -

         # Zone  NAME           STDOFF      RULES  FORMAT  [UNTIL]
         Zone    Europe/Zurich  0:34:08     -      LMT     1853 Jul 16
                                0:29:45.50  -      BMT     1894 Jun
                                1:00        Swiss  CE%sT   1981
                                1:00        EU     CE%sT

         Link    Europe/Zurich  Europe/Vaduz

       In  this  example,  the  EU  rules  are  for the European Union and for its predecessor organization, the
       European Communities.  The timezone is named Europe/Zurich and  it  has  the  alias  Europe/Vaduz.   This
       example  says  that  Zurich  was  34 minutes and 8 seconds east of UT until 1853-07-16 at 00:00, when the
       legal offset was changed to 7 degrees 26 minutes 22.50 seconds, which works out to 0:29:45.50; zic treats
       this by rounding it to 0:29:46.  After 1894-06-01 at 00:00 the  UT  offset  became  one  hour  and  Swiss
       daylight  saving rules (defined with lines beginning with “Rule Swiss”) apply.  From 1981 to the present,
       EU daylight saving rules have applied, and the UTC offset has remained at one hour.

       In 1941 and 1942, daylight saving time applied from the first Monday in May at 01:00 to the first  Monday
       in  October  at  02:00.   The pre-1981 EU daylight-saving rules have no effect here, but are included for
       completeness.  Since 1981, daylight saving has begun on the last Sunday in March  at  01:00  UTC.   Until
       1995  it  ended the last Sunday in September at 01:00 UTC, but this changed to the last Sunday in October
       starting in 1996.

       For purposes of display, “LMT” and “BMT” were initially used, respectively.  Since Swiss rules and  later
       EU  rules  were  applied, the time zone abbreviation has been CET for standard time and CEST for daylight
       saving time.

Files

/etc/localtime
              Default local timezone file.

       /usr/share/zoneinfo
              Default timezone information directory.

Name

       zic - timezone compiler

Notes

       For areas with more than two types of local time, you may need to use local standard time in the AT field
       of the earliest transition time's rule to ensure that  the  earliest  transition  time  recorded  in  the
       compiled file is correct.

       If,  for a particular timezone, a clock advance caused by the start of daylight saving coincides with and
       is equal to a clock retreat caused by a change in UT offset, zic produces a single transition to daylight
       saving at the new UT offset without any change in local (wall clock) time.  To get  separate  transitions
       use multiple zone continuation lines specifying transition instants using universal time.

Options

       --version
              Output version information and exit.

       --help Output short usage message and exit.

       -bbloat
              Output backward-compatibility data as specified by bloat.  If bloat is  fat,  generate  additional
              data  entries  that  work  around  potential  bugs or incompatibilities in older software, such as
              software that mishandles the 64-bit generated data.  If bloat  is  slim,  keep  the  output  files
              small;  this  can help check for the bugs and incompatibilities.  The default is slim, as software
              that mishandles 64-bit data typically mishandles timestamps after the year 2038 anyway.  Also  see
              the -r option for another way to alter output size.

       -ddirectory
              Create  time  conversion  information  files  in  the  named directory rather than in the standard
              directory named below.

       -ltimezone
              Use timezone as local time.  zic will act as if the input contained a link line of the form

                Link  timezone  localtime

              If timezone is -, any already-existing link is removed.

       -Lleapsecondfilename
              Read leap second information from the file with the given name.  If this option is  not  used,  no
              leap second information appears in output files.

       -ptimezone
              Use  timezone's  rules  when handling nonstandard TZ strings like "EET-2EEST" that lack transition
              rules.  zic will act as if the input contained a link line of the form

                Link  timezone  posixrules

              If timezone is “-” (the default), any already-existing link is removed.

              Unless timezoneis “-”, this option is obsolete and  poorly  supported.   Among  other  things  it
              should  not be used for timestamps after the year 2037, and it should not be combined with -bslim
              if timezone's transitions are at standard time or Universal Time (UT) instead of local time.

       -r [@lo][/@hi]
              Limit the applicability of output files to timestamps in the  range  from  lo  (inclusive)  to  hi
              (exclusive),  where  lo  and  hi  are  possibly  signed  decimal counts of seconds since the Epoch
              (1970-01-01 00:00:00 UTC).  Omitted counts default to extreme values.  The  output  files  use  UT
              offset  0 and abbreviation “-00” in place of the omitted timestamp data.  For example, “zic -r @0”
              omits data intended for negative timestamps (i.e., before the Epoch), and “zic -r  @0/@2147483648”
              outputs  data  intended  only for nonnegative timestamps that fit into 31-bit signed integers.  On
              platforms with GNU date, “zic -r @$(date +%s)” omits data intended for past timestamps.   Although
              this  option  typically  reduces  the output file's size, the size can increase due to the need to
              represent the timestamp range boundaries, particularly  if  hi  causes  a  TZif  file  to  contain
              explicit  entries  for pre-hi transitions rather than concisely representing them with an extended
              POSIX.1-2017 TZ string.  Also see the -bslim option for another way to shrink output size.

       -R@hi Generate redundant trailing explicit transitions for timestamps that occur less  than  hi  seconds
              since  the Epoch, even though the transitions could be more concisely represented via the extended
              POSIX.1-2017 TZ string.  This option does not affect  the  represented  timestamps.   Although  it
              accommodates  nonstandard  TZif  readers  that  ignore  the  extended  POSIX.1-2017  TZ string, it
              increases the size of the altered output files.

       -tfile
              When creating local time information, put the configuration link in the named file rather than  in
              the standard location.

       -v     Be more verbose, and complain about the following situations:

              The input specifies a link to a link, something not supported by some older parsers, including zic
              itself through release 2022e.

              A year that appears in a data file is outside the range of representable years.

              A  time  of  24:00  or  more  appears  in the input.  Pre-1998 versions of zic prohibit 24:00, and
              pre-2007 versions prohibit times greater than 24:00.

              A rule goes past the start or end of the month.  Pre-2004 versions of zic prohibit this.

              A time zone abbreviation uses a %z format.  Pre-2015 versions of zic do not support this.

              A timestamp contains fractional seconds.  Pre-2018 versions of zic do not support this.

              The input contains abbreviations that are  mishandled  by  pre-2018  versions  of  zic  due  to  a
              longstanding  coding  bug.   These  abbreviations include “L” for “Link”, “mi” for “min”, “Sa” for
              “Sat”, and “Su” for “Sun”.

              The output file does not contain all the information about the long-term  future  of  a  timezone,
              because the future cannot be summarized as an extended POSIX.1-2017 TZ string.  For example, as of
              2023  this  problem  occurs  for  Morocco's  daylight-saving  rules,  as  these rules are based on
              predictions for when Ramadan will be observed, something that an extended POSIX.1-2017  TZ  string
              cannot represent.

              The  output  contains  data that may not be handled properly by client code designed for older zic
              output formats.  These compatibility issues affect only timestamps before 1970 or after the  start
              of 2038.

              The  output  contains  a  truncated  leap second table, which can cause some older TZif readers to
              misbehave.  This can occur if the -L option is used, and either an Expires line is present or  the
              -r option is also used.

              The output file contains more than 1200 transitions, which may be mishandled by some clients.  The
              current  reference  client  supports  at most 2000 transitions; pre-2014 versions of the reference
              client support at most 1200 transitions.

              A time zone abbreviation has fewer than 3 or more than 6 characters.  POSIX requires at  least  3,
              and requires implementations to support at least 6.

              An  output file name contains a byte that is not an ASCII letter, “-”, “/”, or “_”; or it contains
              a file name component that contains more than 14 bytes or that starts with “-”.

See Also

tzfile(5), zdump(8)

Time Zone Database                                                                                        zic(8)

Synopsis

zic [ option ... ] [ filename ... ]

See Also