zic Command
Purpose
Provides a time zone compiler.
Syntax
zic [ -v ] [ -l LocalTime ] [ -p Posixrules ] [ -d Directory ] [ -L Leapseconds ] [ -y YearIsType ] [ FileName ...]
Description
The zic command processes text from the files named on the command line and creates the time conversion binary files specified in this input. The time zone information is processed from the standard input if file name is specified as - (hyphen).
Input lines in the specified files are made up of fields. Field separators are be any number of white space characters. A pound sign (#) in the input file indicates a comment that extends to the end of the line on which the pound sign appears. White space characters and pound signs can be enclosed in double quotes (") if they are to be used as part of a field. Blank lines are ignored.
Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
- NAME
- Provides a random name for the set of rules for which this Rule is applicable.
- FROM
- Provides the first year in which the rule applies. Specifying
minimum
(min) indicates the minimum year with a representable time value. Specifyingmaximum
(max) indicates the maximum year with a representable time value. - TO
- Provides the final year in which the rule applies. This is indicated
as a valid time value or by specifying
minimum
andmaximum
. Specifyingonly
is used to repeat the value of the FROM field. - TYPE
- Provides the type of year in which the rule applies. The TYPE field has the following values:
- '-'
- The rule applies in all years between FROM and TO, inclusively.
- uspres
- The rule applies in U.S. Presidential election years.
- nonpres
- The rule applies in years other than U.S. Presidential election years.
The yearistype command accepts two parameters; the year and the type of year. An exit status of 0 is taken to mean that the year is of the given type. Otherwise, 1 is returned as exit status.
- IN
- Represents the month in which the rule takes effect. Month names may be abbreviated.
- ON
- Prepresents the day on which the rule takes effect. Recognized
forms include:
- lastFri represents the last Friday in the month.
- lastMon represents the last Monday in the month.
- A number representing the day of the month. For example, 5 represents the fifth of the month.
- lastSun represents the last Sunday in the month.
- lastMon represents the last Monday in the month.
- Sun>=8 represents first Sunday on or after the eighth.
- Sun<=25 represents last Sunday on or before the 25th.
- AT
- Represents the time of day at which the rule takes effect. Recognized
forms include:
- A number representing time in hours. For example, 2 indicates two hours.
- 2:00 indicates two o'clock in hours and minutes.
- 15:00 represents 3 o'clock in the afternoon using the 24-hour format time format.
- 1:28:14 indicates one o'clock, twenty-eight minutes and fourteen seconds, using the hours, minutes, seconds format.
w
if the given time is local wall-clock time ors
if the given time is local standard time. In the absence ofw
ors
, wall-clock time is assumed.Regions with more than two types of local time are required to use the local standard time in the AT field of the earliest transition time's rule to ensure the accuracy of the earliest transition time that is stored in the resulting time-zone binary.
- SAVE
- Prepresents the amount of time to be added to local standard time
when the rule is in effect. This field has the same format as the AT field
The
w
ands
suffixes are not valid with this field. - LETTER/S
- Provides the variable part of the time-zone abbreviations
that are used when this rule is in effect. When this field contains
-
(hyphen), the variable is null. TheS
character is used to indicateEST
and theD
character is used to indicateEDT
.
Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
- NAME
- Indicates the name of the time zone. This is the name used to create the time conversion information file for the zone.
- GMTOFF
- Indicated the amount of time to add to GMT to get standard time in this zone. 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 GMT.
- RULES/SAVE
- Indicated the name of the rules that apply in the time zone or,
alternately, an amount of time to add to local standard time. If value
of this field is
-
(hyphen), then standard time always applies in the time zone. - FORMAT
- Indicates the format for time zone abbreviations in this time
zone. The
%s
characters are used to show where the variable part of the time zone abbreviation goes. - UNTIL
- Indicates the time at which the GMT offset or the rules change for a location. It is specified as year, month, day, and time of day. If this is specified, the time zone information is generated from the given GMT offset and rule change until the time specified.
Zone
string and the name are omitted.
Continuation lines can contain an UNTIL field, just as zone
lines do, indicating that the next line is a further continuation.Link LINK-FROM LINK-TO
The LINK-FROM field
should appear as the NAME field in a zone line; the LINK-TO field
is used as an alternate name for that zone.Except for continuation lines, lines can appear in any order in the input.
The zic command has a limitation of compiling input containing a date before 14 December 1901 because dates before this time cannot be represented by a 32-bit time_t data type.
Flags
Item | Description |
---|---|
-d Directory | Creates time conversion information files in the Directory directory, instead of the/usr/share/lib/zoneinfo/ standard directory . |
-l TimeZone | Use the TimeZone time zone as local time.
The zic command acts as if the file contained a link similar
to the following:
|
-L Leapseconds | Reads the leap second information from the leapseconds file. If this option is not used, leap second information does not appear in the output. |
-p Posixrules | Use the posixrules rules when handling
POSIX-format time zone environment variables. The zic command
acts as if the file contains a link as in this example:
|
-v | Provides a message if a year that appears in a data file is outside the range of years representable by system time values (0:00:00 AM GMT, January 1, 1970, to 3:14:07 AM GMT, January 19, 2038). |
-y YearIsType | Uses the given yearistype command rather than /usr/sbin/yearistype command when used to check year types. |
Parameters
Item | Description |
---|---|
FileName | A file containing input lines that specify
the time conversion information files to be created. If FileName is - (hyphen),
then standard input is read. |
Examples
- A rule line can have the following format:
Rule USA 1970 max - Sep Sun<=14 3:00 0 S
- A zone line can have the following format:
Zone Turkey 3:00 Turkey EET%s
- A link line can have the following format:
Link MET CET
- To compile a timezone.infile file containing input time
zone information and place the binaries into the standard time zone /usr/share/lib/zoneinfo/ directory,
type:
zic timezone.infile
- To compile a timezone.infile file containing input time
zone information and place the binaries into a directory specified
with -d option , type:
zic -d tzdir timezone.infile
- To report warnings during compilation of the time zone input file
when the range of years are incorrect , type:
zic -v timezone.infile
- To compile a timezone.infile file that contains input time
zone information using the yearistype file specified with -y flag
to check year types, type:
zic -y year timezone.infile
Exit Status
- 0
- The command completed successfully.
- >0
- An error occurred.
Files
Item | Description |
---|---|
/usr/sbin/yearistype | Contains the yearistype command used to check year types. |
/usr/sbin/zic | Contains the SystemV zic command. |
/usr/share/lib/zoneinfo | Standard directory used for files create by the zic command. |