xref: /netbsd-src/lib/libc/time/zic.8 (revision 5e4c038a45edbc7d63b7c2daa76e29f88b64a4e3)
1.\"	$NetBSD: zic.8,v 1.11 2002/02/08 01:28:23 ross Exp $
2.\" @(#)zic.8	7.19
3.Dd September 16, 2001
4.Os
5.Dt ZIC 8
6.Sh NAME
7.Nm zic
8.Nd time zone compiler
9.Sh SYNOPSIS
10.Nm
11.Op Fl d Ar directory
12.Op Fl L Ar leapsecondfilename
13.Op Fl l Ar localtime
14.Op Fl p Ar posixrules
15.Op Fl s
16.Op Fl v
17.Op Fl y Ar command
18.Op Ar Filename ...
19.Sh DESCRIPTION
20.Nm
21reads text from the file(s) named on the command line
22and creates the time conversion information files specified in this input.
23If a
24.Ar filename
25is
26.Ar \&- ,
27the standard input is read.
28.Pp
29These options are available:
30.Bl -tag -width XXX -compact
31.It Fl d Ar directory
32Create time conversion information files in the named directory rather than
33in the standard directory named below.
34.It Fl L Ar leapsecondfilename
35Read leap second information from the file with the given name.
36If this option is not used,
37no leap second information appears in output files.
38.It Fl l Ar timezone
39Use the given time zone as local time.
40.Nm
41will act as if the input contained a link line of the form
42.Dl Link	timezone	localtime
43.It Fl p Ar timezone
44Use the given time zone's rules when handling POSIX-format
45time zone environment variables.
46.Nm
47will act as if the input contained a link line of the form
48.Dl Link	timezone	posixrules
49.It Fl s
50Limit time values stored in output files to values that are the same
51whether they're taken to be signed or unsigned.
52You can use this option to generate SVVS-compatible files.
53.It Fl v
54Complain if a year that appears in a data file is outside the range
55of years representable by
56.Xr time 3
57values.
58.It Fl y Ar command
59Use the given
60.Ar command
61rather than
62.Em yearistype
63when checking year types (see below).
64.Pp
65Input lines are made up of fields.
66Fields are separated from one another by any number of white space characters.
67Leading and trailing white space on input lines is ignored.
68An unquoted sharp character (#) in the input introduces a comment which extends
69to the end of the line the sharp character appears on.
70White space characters and sharp characters may be enclosed in double
71quotes
72.Pq \&"
73.\" XXX "
74if they're to be used as part of a field.
75Any line that is blank (after comment stripping) is ignored.
76Non-blank lines are expected to be of one of three types:
77rule lines, zone lines, and link lines.
78.Pp
79A rule line has the form
80.Dl Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
81For example:
82.Dl Rule	US	1967	1973	\-	Apr	lastSun	2:00	1:00	D
83The fields that make up a rule line are:
84.Bl -tag -width "LETTER/S" -compact
85.It NAME
86Gives the (arbitrary) name of the set of rules this rule is part of.
87.It FROM
88Gives the first year in which the rule applies.
89Any integer year can be supplied; the Gregorian calendar is assumed.
90The word
91.Em minimum
92(or an abbreviation) means the minimum year representable as an integer.
93The word
94.Em maximum
95(or an abbreviation) means the maximum year representable as an integer.
96Rules can describe times that are not representable as time values,
97with the unrepresentable times ignored; this allows rules to be portable
98among hosts with differing time value types.
99.It TO
100Gives the final year in which the rule applies.
101In addition to
102.Em minimum
103and
104.Em maximum
105(as above),
106the word
107.Em only
108(or an abbreviation)
109may be used to repeat the value of the
110.Em FROM
111field.
112.It TYPE
113Gives the type of year in which the rule applies.
114If
115.Em TYPE
116is
117.Em \&-
118then the rule applies in all years between
119.Em FROM
120and
121.Em TO
122inclusive.
123If
124.Em TYPE
125is something else, then
126.Nm
127executes the command
128.Pp
129.Ic yearistype Ar year type
130.Pp
131to check the type of a year:
132an exit status of zero is taken to mean that the year is of the given type;
133an exit status of one is taken to mean that the year is not of the given type.
134.It IN
135Names the month in which the rule takes effect.
136Month names may be abbreviated.
137.It ON
138Gives the day on which the rule takes effect.
139Recognized forms include:
140.Bl -tag -width lastSun -compact -offset indent
141.It 5
142the fifth of the month
143.It lastSun
144the last Sunday in the month
145.It lastMon
146the last Monday in the month
147.It Sun\*[Ge]8
148first Sunday on or after the eighth
149.It Sun\*[Le]25
150last Sunday on or before the 25th
151.El
152Names of days of the week may be abbreviated or spelled out in full.
153Note that there must be no spaces within the
154.Em ON
155field.
156.It AT
157Gives the time of day at which the rule takes effect.
158Recognized forms include:
159.Bl -tag -width "1:28:14" -compact -offset indent
160.It 2
161time in hours
162.It 2:00
163time in hours and minutes
164.It 15:00
16524-hour format time (for times after noon)
166.It 1:28:14
167time in hours, minutes, and seconds
168.It \-
169equivalent to 0
170.El
171where hour 0 is midnight at the start of the day,
172and hour 24 is midnight at the end of the day.
173Any of these forms may be followed by the letter
174.Em w
175if the given time is local
176.Dq wall clock
177time,
178.Em s
179if the given time is local
180.Dq standard
181time, or
182.Em u
183(or
184.Em g
185or
186.Em z )
187if the given time is universal time;
188in the absence of an indicator,
189wall clock time is assumed.
190.It SAVE
191Gives the amount of time to be added to local standard time when the rule is in
192effect.
193This field has the same format as the
194.Em AT
195field
196(although, of course, the
197.Em w
198and
199.Em s
200suffixes are not used).
201.It LETTER/S
202Gives the
203.Dq variable part
204(for example, the
205.Dq S
206or
207.Dq D
208in
209.Dq EST
210or
211.Dq EDT )
212of time zone abbreviations to be used when this rule is in effect.
213If this field is
214.Em \&- ,
215the variable part is null.
216.El
217.Pp
218A zone line has the form
219.Dl Zone	NAME		GMTOFF	RULES/SAVE	FORMAT	[UNTIL]
220For example:
221.Dl Zone	Australia/Adelaide	9:30	Aus	CST	1971 Oct 31 2:00
222The fields that make up a zone line are:
223.Bl -tag -width "RULES/SAVE" -compact
224.It NAME
225The name of the time zone.
226This is the name used in creating the time conversion information file for the
227zone.
228.It GMTOFF
229The amount of time to add to UTC to get standard time in this zone.
230This field has the same format as the
231.Em AT
232and
233.Em SAVE
234fields of rule lines;
235begin the field with a minus sign if time must be subtracted from UTC.
236.It RULES/SAVE
237The name of the rule(s) that apply in the time zone or,
238alternatively, an amount of time to add to local standard time.
239If this field is
240.Em \&-
241then standard time always applies in the time zone.
242.It FORMAT
243The format for time zone abbreviations in this time zone.
244The pair of characters
245.Em %s
246is used to show where the
247.Dq variable part
248of the time zone abbreviation goes.
249Alternatively,
250a slash
251.Pq \&/
252separates standard and daylight abbreviations.
253.It UNTIL
254The time at which the UTC offset or the rule(s) change for a location.
255It is specified as a year, a month, a day, and a time of day.
256If this is specified,
257the time zone information is generated from the given UTC offset
258and rule change until the time specified.
259The month, day, and time of day have the same format as the IN, ON, and AT
260columns of a rule; trailing columns can be omitted, and default to the
261earliest possible value for the missing columns.
262.El
263The next line must be a
264.Dq continuation
265line; this has the same form as a zone line except that the
266string
267.Dq Zone
268and the name are omitted, as the continuation line will
269place information starting at the time specified as the
270.Em UNTIL
271field in the previous line in the file used by the previous line.
272Continuation lines may contain an
273.Em UNTIL
274field, just as zone lines do, indicating that the next line is a further
275continuation.
276.Pp
277A link line has the form
278.Dl Link	LINK-FROM	LINK-TO
279For example:
280.Dl Link	Europe/Istanbul	Asia/Istanbul
281The
282.Em LINK-FROM
283field should appear as the
284.Em NAME
285field in some zone line;
286the
287.Em LINK-TO
288field is used as an alternative name for that zone.
289.Pp
290Except for continuation lines,
291lines may appear in any order in the input.
292.Pp
293Lines in the file that describes leap seconds have the following form:
294.Dl Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
295For example:
296.Dl Leap	1974	Dec	31	23:59:60	+	S
297The
298.Em YEAR ,
299.Em MONTH ,
300.Em DAY ,
301and
302.Em HH:MM:SS
303fields tell when the leap second happened.
304The
305.Em CORR
306field
307should be
308.Dq \&+
309if a second was added
310or
311.Dq \&-
312if a second was skipped.
313.\" There's no need to document the following, since it's impossible for more
314.\" than one leap second to be inserted or deleted at a time.
315.\" The C Standard is in error in suggesting the possibility.
316.\" See Terry J Quinn, The BIPM and the accurate measure of time,
317.\" Proc IEEE 79, 7 (July 1991), 894-905.
318.\"	or
319.\"	.Dq ++
320.\"	if two seconds were added
321.\"	or
322.\"	.Dq --
323.\"	if two seconds were skipped.
324The
325.Em R/S
326field
327should be (an abbreviation of)
328.Dq Stationary
329if the leap second time given by the other fields should be interpreted as UTC
330or
331(an abbreviation of)
332.Dq Rolling
333if the leap second time given by the other fields should be interpreted as
334local wall clock time.
335.El
336.Sh NOTES
337For areas with more than two types of local time,
338you may need to use local standard time in the
339.Em AT
340field of the earliest transition time's rule to ensure that
341the earliest transition time recorded in the compiled file is correct.
342.Sh FILES
343.Pa /usr/share/zoneinfo
344- standard directory used for created files
345.Sh SEE ALSO
346.Xr ctime 3 ,
347.Xr tzfile 5 ,
348.Xr zdump 8
349