You are on page 1of 5


zic -- timezone compiler
zic [--version] [-Dsv] [-d directory] [-g group] [-L leapsecondfilename]
[-l localtime] [-m mode] [-p posixrules] [-u user] [-y command]
[filename ...]
The zic utility reads text from the file(s) named on the command line and
creates the time conversion information files specified in this input.
If a filename is -, the standard input is read.
The following options are available:
Output version information and exit.

Do not automatically create directories. If the input file(s)
specify an output file in a directory which does not already
exist, the default behavior is to attempt to create the directory. If -D is specified, zic will instead error out immediately.

-d directory
Create time conversion information files in the named directory
rather than in the standard directory named below.
-g group
After creating each output file, change its group ownership to
the specified group (which can be either a name or a numeric
group ID).
-L leapsecondfilename
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.
-l timezone
Use the given time zone as local time. The zic utility will act
as if the input contained a link line of the form
Link timezone


(Note that this action has no effect on FreeBSD, since the local
time zone is specified in /etc/localtime and not
-m mode
After creating each output file, change its access mode to mode.
Both numeric and alphabetic modes are accepted (see chmod(1)).
-p timezone
Use the given time zone's rules when handling POSIX-format time
zone environment variables. The zic utility will act as if the
input contained a link line of the form
Link timezone
-u user


Input lines are made up of fields. Rules can describe times that are not representable as time values. then zic executes the command yearistype year type to check the type of a year: an exit status of zero is taken to mean that the year is of the given type. If TYPE is . Abbreviations. TO Give the final year in which the rule applies. The word maximum (or an abbreviation) means the maximum year representable as an integer.After creating each output file. FROM Give the first year in which the rule applies. this allows rules to be portable among hosts with differing time value types. Any integer year can be supplied. Leading and trailing white space on input lines is ignored. an exit status of one is taken to mean that the year is not of the given type. change its owner to user (which can be either a name or a numeric user ID). TYPE Give the type of year in which the rule applies. the Gregorian calendar is assumed. Any line that is blank (after comment stripping) is ignored. -v Complain if a year that appears in a data file is outside the range of years representable by time(3) values.then the rule applies in all years between FROM and TO inclusive. zone lines. with the unrepresentable times ignored. In addition to minimum and maximum (as above). A rule line has the form: Rule NAME FROM TO TYPE IN ON For example: Rule US 1967 1973 Apr lastSun AT SAVE LETTER/S 2:00 1:00 D The fields that make up a rule line are: NAME Give the (arbitrary) name of the set of rules this rule is part of. Fields are separated from one another by any number of white space characters. if used. White space characters and sharp characters may be enclosed in double quotes (") if they are to be used as part of a field. -s Limit time values stored in output files to values that are the same whether they are taken to be signed or unsigned. Names (such as month names) must be in English and are case insensitive. The word minimum (or an abbreviation) means the minimum year representable as an integer. must be unambiguous in context. If TYPE is something else. and link lines. -y command Use the given command rather than yearistype when checking year types (see below). . Non-blank lines are expected to be of one of three types: rule lines. the word only (or an abbreviation) may be used to repeat the value of the FROM field. You can use this option to generate SVVS-compatible files. An unquoted sharp character (#) in the input introduces a comment which extends to the end of the line the sharp character appears on.

Recognized forms include: 2 2:00 15:00 1:28:14 time in time in 24-hour time in hours hours and minutes format time (for times after noon) hours. and hour 24 is midnight at the end of the day. Recognized forms include: 5 lastSun lastMon Sun>=8 Sun<=25 the fifth of the month the last Sunday in the month the last Monday in the month first Sunday on or after the eighth last Sunday on or before the 25th Names of days of the week may be abbreviated or spelled out in full. SAVE Give the amount of time to be added to local standard time when the rule is in effect. `s' if the given time is local ``standard'' time. in the absence of an indicator. If this field is -. ON Give the day on which the rule takes effect. AT Give the time of day at which the rule takes effect. This is the name used in creating the time conversion information file for the zone. of course. GMTOFF The amount of time to add to UTC to get standard time in this zone. RULES/SAVE The name of the rule(s) that apply in the time zone or. the ``S'' or ``D'' in ``EST'' or ``EDT'') of time zone abbreviations to be used when this rule is in effect. and seconds where hour 0 is midnight at the start of the day. This field has the same format as the AT and SAVE fields of rule lines. begin the field with a minus sign if time must be subtracted from UTC. the variable part is null.IN Name the month in which the rule takes effect. If this . or `u' (or `g' or `z') if the given time is universal time. alternately. an amount of time to add to local standard time. A zone line has the form: Zone NAME GMTOFF RULES/SAVE FORMAT [UNTILYEAR [MONTH [DAY [TIME]]]] For example: Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 The fields that make up a zone line are: NAME The name of the time zone. Note that there must be no spaces within the ON field. LETTER/S Give the ``variable part'' (for example. minutes. Any of these forms may be followed by the letter `w' if the given time is local ``wall clock'' time. This field has the same format as the AT field (although. Month names may be abbreviated. the `w' and `s' suffixes are not used). wall clock time is assumed.

ON. If this is specified. this has the same form as a zone line except that the string ``Zone'' and the name are omitted. a day. The R/S field should be (an abbreviation of) ``Stationary'' if the leap second time given by the other fields should be interpreted as UTC or (an abbreviation of) ``Rolling'' if the leap second time given by the other fields should be interpreted as local wall clock time. EXTENDED EXAMPLE Here is an extended example of zic input. and time of day have the same format as the IN. DAY. The month. # Rule Rule Rule Rule Rule Rule Rule Rule Rule NAME Swiss Swiss Swiss Swiss EU EU EU EU FROM 1940 1940 1941 1941 1977 1977 1978 1979 TO only only 1942 1942 1980 only only 1995 TYPE - IN Nov Dec May Oct Apr Sep Oct Sep ON 2 31 Sun>=1 Sun>=1 Sun>=1 lastSun 1 lastSun AT 0:00 0:00 2:00 0:00 1:00u 1:00u 1:00u 1:00u SAVE 1:00 0 1:00 0 1:00 0 0 0 LETTER/S S S S - . Lines in the file that describes leap seconds have the following form: Leap YEAR MONTH DAY HH:MM:SS CORR R/S For example: Leap 1974 Dec 31 23:59:60 + S The YEAR. indicating that the next line is a further continuation. Alternately. A link line has the form Link LINK-FROM LINK-TO For example: Link Europe/Istanbul Asia/Istanbul The LINK-FROM field should appear as the NAME field in some zone line. lines may appear in any order in the input. Continuation lines may contain until information. and default to the earliest possible value for the missing fields. The pair of characters %s is used to show where the ``variable part'' of the time zone abbreviation goes. just as zone lines do. intended to illustrate many of its features.field is . and AT fields of a rule. a month. The CORR field should be ``+'' if a second was added or ``-'' if a second was skipped. FORMAT The format for time zone abbreviations in this time zone. the time zone information is generated from the given UTC offset and rule change until the time specified. a slash (/) separates standard and daylight abbreviations. MONTH. and a time of day. and HH:MM:SS fields tell when the leap second happened.then standard time always applies in the time zone. the LINK-TO field is used as an alternate name for that zone. The next line must be a ``continuation'' line. day. trailing fields can be omitted. UNTILYEAR [MONTH [DAY [TIME]]] The time at which the UTC offset or the rule(s) change for a location. as the continuation line will place information starting at the time specified as the until information in the previous line in the file used by the previous line. It is specified as a year. Except for continuation lines.

In 1940. EU daylight saving rules have applied. daylight saving time applied from the first Sunday in May at 02:00 to the first Sunday in October at 00:00. . Until 1995 it ended the last Sunday in September at 01:00 UTC. zic produces a single transition to daylight saving at the new UTC offset (without any change in wall clock time). and the GMT offset became one hour. NOTES For areas with more than two types of local time. respectively. but this changed to the last Sunday in October starting in 1996. when the offset changed to 29 minutes and 44 seconds. daylight saving has begun on the last Sunday in March at 01:00 UTC. "LMT" and "BMT" were initially used. For purposes of display. If. a clock advance caused by the start of daylight saving coincides with and is equal to a clock retreat caused by a change in UTC offset. To get separate transitions use multiple zone continuation lines specifying transition instants using universal time. the display name for the timezone has been CET for standard time and CEST for daylight saving time.Rule Rule EU EU 1981 max 1996 max - # Zone NAME GMTOFF Zone Europe/Zurich 0:34:08 0:29:44 1:00 1:00 Link Mar lastSun 1:00u 1:00 S Oct lastSun 1:00u 0 RULES Swiss EU FORMAT LMT BMT CE%sT CE%sT UNTIL 1848 Sep 12 1894 Jun 1981 Europe/Zurich Switzerland In this example. but are included for completeness. Since 1981. the zone is named Europe/Zurich but it has an alias as Switzerland. and the UTC offset has remained at one hour. Zurich was 34 minutes and 8 seconds west of GMT until 1848-09-12 at 00:00. daylight saving time applied from November 2 at 00:00 to December 31 at 00:00. Since Swiss rules and later EU rules were applied. After 1894-06-01 at 00:00 Swiss daylight saving rules (defined with lines beginning with "Rule Swiss") apply. 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. From 1981 to the present. for a particular zone. In 1941 and 1942. The pre-1981 EU daylight-saving rules have no effect here.