1986-02-15 16:30:57 -05:00
|
|
|
.TH TZFILE 5
|
|
|
|
|
.SH NAME
|
|
|
|
|
tzfile \- time zone information
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
.B
|
1986-08-28 09:04:52 -04:00
|
|
|
#include <tzfile.h>
|
1986-02-15 16:30:57 -05:00
|
|
|
.SH DESCRIPTION
|
|
|
|
|
The time zone information files used by
|
1987-02-21 18:26:20 -05:00
|
|
|
.IR tzset (3)
|
2009-12-12 09:05:09 -05:00
|
|
|
begin with the magic characters "TZif" to identify them as
|
1997-11-20 17:34:38 -05:00
|
|
|
time zone information files,
|
2006-02-20 09:53:12 -05:00
|
|
|
followed by a character identifying the version of the file's format
|
2013-09-08 23:04:07 -07:00
|
|
|
(as of 2013, either an ASCII NUL, or '2', or '3')
|
2006-02-20 09:53:12 -05:00
|
|
|
followed by fifteen bytes containing zeroes reserved for future use,
|
2013-09-10 12:49:45 -07:00
|
|
|
followed by six four-byte integer values
|
2014-08-12 19:00:04 -07:00
|
|
|
written in a standard byte order
|
1986-12-26 22:47:47 -05:00
|
|
|
(the high-order byte of the value is written first).
|
|
|
|
|
These values are,
|
1986-08-28 09:04:52 -04:00
|
|
|
in order:
|
|
|
|
|
.TP
|
1995-01-03 20:09:47 -05:00
|
|
|
.I tzh_ttisgmtcnt
|
2013-09-04 19:07:31 -07:00
|
|
|
The number of UT/local indicators stored in the file.
|
1995-01-03 20:09:47 -05:00
|
|
|
.TP
|
1989-03-02 10:35:26 -05:00
|
|
|
.I tzh_ttisstdcnt
|
|
|
|
|
The number of standard/wall indicators stored in the file.
|
|
|
|
|
.TP
|
1988-01-25 11:17:17 -05:00
|
|
|
.I tzh_leapcnt
|
2014-08-12 22:20:23 -07:00
|
|
|
The number of leap seconds for which data entries are stored in the file.
|
1988-01-25 11:17:17 -05:00
|
|
|
.TP
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tzh_timecnt
|
2014-08-12 22:20:23 -07:00
|
|
|
The number of transition times for which data entries are stored
|
1986-08-28 09:04:52 -04:00
|
|
|
in the file.
|
|
|
|
|
.TP
|
|
|
|
|
.I tzh_typecnt
|
2014-08-12 22:20:23 -07:00
|
|
|
The number of local time types for which data entries are stored
|
1986-08-28 09:04:52 -04:00
|
|
|
in the file (must not be zero).
|
|
|
|
|
.TP
|
|
|
|
|
.I tzh_charcnt
|
2014-08-12 19:00:04 -07:00
|
|
|
The number of characters of time zone abbreviation strings
|
1986-03-02 22:03:34 -05:00
|
|
|
stored in the file.
|
1986-02-15 16:30:57 -05:00
|
|
|
.PP
|
1986-03-02 22:03:34 -05:00
|
|
|
The above header is followed by
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tzh_timecnt
|
2013-09-10 12:49:45 -07:00
|
|
|
four-byte signed integer values sorted in ascending order.
|
2014-08-12 19:00:04 -07:00
|
|
|
These values are written in standard byte order.
|
1986-08-28 09:04:52 -04:00
|
|
|
Each is used as a transition time (as returned by
|
1986-03-02 22:03:34 -05:00
|
|
|
.IR time (2))
|
|
|
|
|
at which the rules for computing local time change.
|
|
|
|
|
Next come
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tzh_timecnt
|
2013-09-10 12:49:45 -07:00
|
|
|
one-byte unsigned integer values;
|
2014-08-12 19:00:04 -07:00
|
|
|
each one tells which of the different types of local time types
|
1986-12-26 22:47:47 -05:00
|
|
|
described in the file is associated with the same-indexed transition time.
|
1986-03-02 22:03:34 -05:00
|
|
|
These values serve as indices into an array of
|
1986-08-28 09:04:52 -04:00
|
|
|
.I ttinfo
|
2007-12-27 12:27:06 -05:00
|
|
|
structures (with
|
|
|
|
|
.I tzh_typecnt
|
|
|
|
|
entries) that appears next in the file;
|
1986-03-02 22:03:34 -05:00
|
|
|
these structures are defined as follows:
|
|
|
|
|
.in +.5i
|
|
|
|
|
.sp
|
|
|
|
|
.nf
|
2013-09-10 12:49:45 -07:00
|
|
|
.ta .5i +\w'unsigned char\0\0'u
|
1989-03-30 22:02:10 -05:00
|
|
|
struct ttinfo {
|
2013-09-10 12:49:45 -07:00
|
|
|
int32_t tt_gmtoff;
|
|
|
|
|
unsigned char tt_isdst;
|
|
|
|
|
unsigned char tt_abbrind;
|
1986-03-02 22:03:34 -05:00
|
|
|
};
|
|
|
|
|
.in -.5i
|
|
|
|
|
.fi
|
|
|
|
|
.sp
|
2013-09-10 12:49:45 -07:00
|
|
|
Each structure is written as a four-byte signed integer value for
|
|
|
|
|
.IR tt_gmtoff ,
|
1986-08-28 09:04:52 -04:00
|
|
|
in a standard byte order, followed by a one-byte value for
|
|
|
|
|
.I tt_isdst
|
|
|
|
|
and a one-byte value for
|
|
|
|
|
.IR tt_abbrind .
|
1986-03-02 22:03:34 -05:00
|
|
|
In each structure,
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tt_gmtoff
|
2013-09-04 19:07:31 -07:00
|
|
|
gives the number of seconds to be added to UT,
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tt_isdst
|
1986-02-15 16:30:57 -05:00
|
|
|
tells whether
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tm_isdst
|
1986-02-15 16:30:57 -05:00
|
|
|
should be set by
|
1987-02-19 08:32:11 -05:00
|
|
|
.I localtime (3)
|
1986-03-02 22:03:34 -05:00
|
|
|
and
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tt_abbrind
|
1987-02-21 17:27:47 -05:00
|
|
|
serves as an index into the array of time zone abbreviation characters
|
1986-03-02 22:03:34 -05:00
|
|
|
that follow the
|
1986-08-28 09:04:52 -04:00
|
|
|
.I ttinfo
|
1986-03-02 22:03:34 -05:00
|
|
|
structure(s) in the file.
|
1986-02-15 16:30:57 -05:00
|
|
|
.PP
|
1989-03-02 10:35:26 -05:00
|
|
|
Then there are
|
1988-01-25 11:17:17 -05:00
|
|
|
.I tzh_leapcnt
|
|
|
|
|
pairs of four-byte values, written in standard byte order;
|
|
|
|
|
the first value of each pair gives the time
|
1989-03-30 22:02:10 -05:00
|
|
|
(as returned by
|
1988-01-25 11:17:17 -05:00
|
|
|
.IR time(2))
|
|
|
|
|
at which a leap second occurs;
|
|
|
|
|
the second gives the
|
|
|
|
|
.I total
|
|
|
|
|
number of leap seconds to be applied after the given time.
|
|
|
|
|
The pairs of values are sorted in ascending order by time.
|
|
|
|
|
.PP
|
1995-01-03 20:09:47 -05:00
|
|
|
Then there are
|
1989-03-02 10:35:26 -05:00
|
|
|
.I tzh_ttisstdcnt
|
|
|
|
|
standard/wall indicators, each stored as a one-byte value;
|
|
|
|
|
they tell whether the transition times associated with local time types
|
|
|
|
|
were specified as standard time or wall clock time,
|
|
|
|
|
and are used when a time zone file is used in handling POSIX-style
|
|
|
|
|
time zone environment variables.
|
|
|
|
|
.PP
|
1997-12-18 17:45:41 -05:00
|
|
|
Finally there are
|
1995-01-03 20:09:47 -05:00
|
|
|
.I tzh_ttisgmtcnt
|
2013-09-04 19:07:31 -07:00
|
|
|
UT/local indicators, each stored as a one-byte value;
|
1995-01-03 20:09:47 -05:00
|
|
|
they tell whether the transition times associated with local time types
|
2013-09-04 19:07:31 -07:00
|
|
|
were specified as UT or local time,
|
1995-01-03 20:09:47 -05:00
|
|
|
and are used when a time zone file is used in handling POSIX-style
|
|
|
|
|
time zone environment variables.
|
|
|
|
|
.PP
|
1987-02-19 08:32:11 -05:00
|
|
|
.I Localtime
|
1986-11-24 16:37:56 -05:00
|
|
|
uses the first standard-time
|
1986-08-28 09:04:52 -04:00
|
|
|
.I ttinfo
|
1986-03-02 22:03:34 -05:00
|
|
|
structure in the file
|
1986-11-24 16:37:56 -05:00
|
|
|
(or simply the first
|
|
|
|
|
.I ttinfo
|
|
|
|
|
structure in the absence of a standard-time structure)
|
1986-02-15 16:30:57 -05:00
|
|
|
if either
|
1986-08-28 09:04:52 -04:00
|
|
|
.I tzh_timecnt
|
1987-02-19 08:32:11 -05:00
|
|
|
is zero or the time argument is less than the first transition time recorded
|
|
|
|
|
in the file.
|
2006-02-20 09:53:12 -05:00
|
|
|
.PP
|
|
|
|
|
For version-2-format time zone files,
|
2012-11-11 23:42:00 -08:00
|
|
|
the above header and data are followed by a second header and data,
|
2006-02-20 09:53:12 -05:00
|
|
|
identical in format except that
|
|
|
|
|
eight bytes are used for each transition time or leap second time.
|
2013-09-11 02:42:07 -07:00
|
|
|
After the second header and data comes a newline-enclosed,
|
2006-02-20 09:53:12 -05:00
|
|
|
POSIX-TZ-environment-variable-style string for use in handling instants
|
|
|
|
|
after the last transition time stored in the file
|
|
|
|
|
(with nothing between the newlines if there is no POSIX representation for
|
|
|
|
|
such instants).
|
2013-09-08 23:04:07 -07:00
|
|
|
.PP
|
2013-09-11 02:42:07 -07:00
|
|
|
For version-3-format time zone files, the POSIX-TZ-style string may
|
|
|
|
|
use two minor extensions to the POSIX TZ format, as described in
|
2013-09-08 23:04:07 -07:00
|
|
|
.IR newtzset (3).
|
Improve the support for perpetual DST.
Problem reported by Zefram in
<http://mm.icann.org/pipermail/tz/2013-September/020059.html>.
* localtime.c (tzparse): Elide simultaneous entries out of and
into DST if DST goes for an hour more than a year (actually, for
more than the DST offset more than a year). Since this
optimization can elide all entries, avoid looping forever looking
for entries that will never arrive. While we're at it, fix
another portability bug where the code assumed wraparound on
signed integer overflow.
* newtzset.3, tzfile.5: Mention that as an extension to POSIX,
if DST covers the entire year plus the DST offset, it's assumed to
be in effect all year. Give an example.
* zic.c (stringrule): Omit the "J" in January and February,
as this can save a byte or two in the output.
(rule_cmp): New function.
(stringzone): Do a better job of constructing the standard-time
abbreviation when there is perpetual DST. Defer to the new
stringrule to construct the times for perpetual DST.
Fix bug noted by Zefram, which caused a stray hour of standard
time to be inserted in an otherwise perpetual DST.
Previously, this code generated "WARST4WARST,J1/0,J365/24"
for the San Luis example; now it generates "WART4WARST,0/0,J365/25".
2013-09-08 07:49:22 -07:00
|
|
|
First, the hours part of its transition times may be signed and range from
|
2014-06-28 16:35:14 -07:00
|
|
|
\-167 through 167 instead of the POSIX-required unsigned values
|
Improve the support for perpetual DST.
Problem reported by Zefram in
<http://mm.icann.org/pipermail/tz/2013-September/020059.html>.
* localtime.c (tzparse): Elide simultaneous entries out of and
into DST if DST goes for an hour more than a year (actually, for
more than the DST offset more than a year). Since this
optimization can elide all entries, avoid looping forever looking
for entries that will never arrive. While we're at it, fix
another portability bug where the code assumed wraparound on
signed integer overflow.
* newtzset.3, tzfile.5: Mention that as an extension to POSIX,
if DST covers the entire year plus the DST offset, it's assumed to
be in effect all year. Give an example.
* zic.c (stringrule): Omit the "J" in January and February,
as this can save a byte or two in the output.
(rule_cmp): New function.
(stringzone): Do a better job of constructing the standard-time
abbreviation when there is perpetual DST. Defer to the new
stringrule to construct the times for perpetual DST.
Fix bug noted by Zefram, which caused a stray hour of standard
time to be inserted in an otherwise perpetual DST.
Previously, this code generated "WARST4WARST,J1/0,J365/24"
for the San Luis example; now it generates "WART4WARST,0/0,J365/25".
2013-09-08 07:49:22 -07:00
|
|
|
from 0 through 24. Second, DST is in effect all year if it starts
|
|
|
|
|
January 1 at 00:00 and ends December 31 at 24:00 plus the difference
|
|
|
|
|
between daylight saving and standard time.
|
2013-09-09 17:16:37 -07:00
|
|
|
.PP
|
2013-09-11 02:42:07 -07:00
|
|
|
Future changes to the format may append more data.
|
1986-02-15 16:30:57 -05:00
|
|
|
.SH SEE ALSO
|
2013-09-15 23:15:13 -05:00
|
|
|
newctime(3), newtzset(3), zdump(8), zic(8)
|
1996-06-05 08:02:00 -04:00
|
|
|
.\" This file is in the public domain, so clarified as of
|
2005-12-08 11:35:32 -05:00
|
|
|
.\" 1996-06-05 by Arthur David Olson.
|