[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Commands Reference, Volume 6
zic Command
Purpose
Provides a time zone compiler.
Syntax
zic [ -v ] [ -d Directory ] [ -l LocalTime ] [ -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.
A rule line has the form:
Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
The fields that make up the rule line are as follows:
- 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.
Specifying maximum (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 spcifying minimum and maximum. Specifying only 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.
If the TYPE field has a value other than what is
mentioned above, the zic command runs the /usr/sbin/yearistype year type command to check the type of year.
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.
Names of days of the week can be abbreviated or spelled out in full.
Note that there must be no spaces within the ON field.
- AT
- Prepresents 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.
Any of these forms may be followed by the letter w if the
given time is local wall-clock time or s if
the given time is local standard time. In the absence
of w or s, 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 and s 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. The S character is used
to indicate EST and the D character is used to indicate EDT.
A zone line has the form:
Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
The fields that make up a zone line are:
- 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.
The next line must be a continuation line. The
continuation line places information starting at the time specified in the UNTIL field of the previous line into the file used by the
previous line. This line has the same format as a zone line, except that the 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.
A link line has the form:
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 conintuation lines, lines can appear in any order in the input.
Flags
-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:
Link timezone localtime |
-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
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
/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. |
Related Information
The zdump command.
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]