1994-09-13 21:26:08 +00:00
|
|
|
.Dd September 13, 1994
|
|
|
|
.Dt TZFILE 5
|
|
|
|
.Os FreeBSD 2.0
|
|
|
|
.Sh NAME
|
|
|
|
.Nm tzfile
|
1996-02-28 11:59:50 +00:00
|
|
|
.Nd timezone information
|
1994-09-13 21:26:08 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Fd #include <tzfile.h>
|
|
|
|
.Sh DESCRIPTION
|
1994-09-13 03:39:01 +00:00
|
|
|
The time zone information files used by
|
1994-09-13 21:26:08 +00:00
|
|
|
.Xr tzset 3
|
1994-09-13 03:39:01 +00:00
|
|
|
begin with bytes reserved for future use,
|
1998-05-10 21:21:01 +00:00
|
|
|
followed by four four-byte values
|
1994-09-13 03:39:01 +00:00
|
|
|
written in a ``standard'' byte order
|
|
|
|
(the high-order byte of the value is written first).
|
|
|
|
These values are,
|
|
|
|
in order:
|
1994-09-13 21:26:08 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -tag -compact -width tzh_ttisstdcnt
|
|
|
|
.It Li tzh_ttisstdcnt
|
1994-09-13 03:39:01 +00:00
|
|
|
The number of standard/wall indicators stored in the file.
|
1994-09-13 21:26:08 +00:00
|
|
|
.It Li tzh_leapcnt
|
1994-09-13 03:39:01 +00:00
|
|
|
The number of leap seconds for which data is stored in the file.
|
1994-09-13 21:26:08 +00:00
|
|
|
.It Li tzh_timecnt
|
|
|
|
The number of ``transition times'' for which data is stored
|
1994-09-13 03:39:01 +00:00
|
|
|
in the file.
|
1994-09-13 21:26:08 +00:00
|
|
|
.It Li tzh_typecnt
|
|
|
|
The number of ``local time types'' for which data is stored
|
1994-09-13 03:39:01 +00:00
|
|
|
in the file (must not be zero).
|
1994-09-13 21:26:08 +00:00
|
|
|
.It Li tzh_charcnt
|
|
|
|
The number of characters of ``time zone abbreviation strings''
|
1994-09-13 03:39:01 +00:00
|
|
|
stored in the file.
|
1994-09-13 21:26:08 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
1994-09-13 03:39:01 +00:00
|
|
|
The above header is followed by
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tzh_timecnt
|
1994-09-13 03:39:01 +00:00
|
|
|
four-byte values of type
|
1994-09-13 21:26:08 +00:00
|
|
|
.Fa long ,
|
1994-09-13 03:39:01 +00:00
|
|
|
sorted in ascending order.
|
|
|
|
These values are written in ``standard'' byte order.
|
|
|
|
Each is used as a transition time (as returned by
|
1996-04-07 00:06:21 +00:00
|
|
|
.Xr time 3 )
|
1994-09-13 03:39:01 +00:00
|
|
|
at which the rules for computing local time change.
|
|
|
|
Next come
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tzh_timecnt
|
1994-09-13 03:39:01 +00:00
|
|
|
one-byte values of type
|
1994-09-13 21:26:08 +00:00
|
|
|
.Fa "unsigned char" ;
|
1994-09-13 03:39:01 +00:00
|
|
|
each one tells which of the different types of ``local time'' types
|
|
|
|
described in the file is associated with the same-indexed transition time.
|
|
|
|
These values serve as indices into an array of
|
1994-09-13 21:26:08 +00:00
|
|
|
.Fa ttinfo
|
1994-09-13 03:39:01 +00:00
|
|
|
structures that appears next in the file;
|
|
|
|
these structures are defined as follows:
|
1994-09-13 21:26:08 +00:00
|
|
|
.Pp
|
|
|
|
.Bd -literal -offset indent
|
1994-09-13 03:39:01 +00:00
|
|
|
struct ttinfo {
|
|
|
|
long tt_gmtoff;
|
|
|
|
int tt_isdst;
|
|
|
|
unsigned int tt_abbrind;
|
|
|
|
};
|
1994-09-13 21:26:08 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
1994-09-13 03:39:01 +00:00
|
|
|
Each structure is written as a four-byte value for
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tt_gmtoff
|
1994-09-13 03:39:01 +00:00
|
|
|
of type
|
1994-09-13 21:26:08 +00:00
|
|
|
.Fa long ,
|
1994-09-13 03:39:01 +00:00
|
|
|
in a standard byte order, followed by a one-byte value for
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tt_isdst
|
1994-09-13 03:39:01 +00:00
|
|
|
and a one-byte value for
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tt_abbrind .
|
1994-09-13 03:39:01 +00:00
|
|
|
In each structure,
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tt_gmtoff
|
1994-09-13 03:39:01 +00:00
|
|
|
gives the number of seconds to be added to GMT,
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tt_isdst
|
1994-09-13 03:39:01 +00:00
|
|
|
tells whether
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tm_isdst
|
1994-09-13 03:39:01 +00:00
|
|
|
should be set by
|
1994-09-13 21:26:08 +00:00
|
|
|
.Xr localtime 3
|
1994-09-13 03:39:01 +00:00
|
|
|
and
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tt_abbrind
|
1994-09-13 03:39:01 +00:00
|
|
|
serves as an index into the array of time zone abbreviation characters
|
|
|
|
that follow the
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li ttinfo
|
1994-09-13 03:39:01 +00:00
|
|
|
structure(s) in the file.
|
1994-09-13 21:26:08 +00:00
|
|
|
.Pp
|
1994-09-13 03:39:01 +00:00
|
|
|
Then there are
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tzh_leapcnt
|
1994-09-13 03:39:01 +00:00
|
|
|
pairs of four-byte values, written in standard byte order;
|
|
|
|
the first value of each pair gives the time
|
|
|
|
(as returned by
|
1996-04-07 00:06:21 +00:00
|
|
|
.Xr time 3 )
|
1994-09-13 03:39:01 +00:00
|
|
|
at which a leap second occurs;
|
|
|
|
the second gives the
|
1994-09-13 21:26:08 +00:00
|
|
|
.Em total
|
1994-09-13 03:39:01 +00:00
|
|
|
number of leap seconds to be applied after the given time.
|
|
|
|
The pairs of values are sorted in ascending order by time.
|
1994-09-13 21:26:08 +00:00
|
|
|
.Pp
|
1994-09-13 03:39:01 +00:00
|
|
|
Finally there are
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tzh_ttisstdcnt
|
1994-09-13 03:39:01 +00:00
|
|
|
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.
|
1994-09-13 21:26:08 +00:00
|
|
|
.Pp
|
|
|
|
.Nm localtime
|
1994-09-13 03:39:01 +00:00
|
|
|
uses the first standard-time
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li ttinfo
|
1994-09-13 03:39:01 +00:00
|
|
|
structure in the file
|
|
|
|
(or simply the first
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li ttinfo
|
1994-09-13 03:39:01 +00:00
|
|
|
structure in the absence of a standard-time structure)
|
|
|
|
if either
|
1994-09-13 21:26:08 +00:00
|
|
|
.Li tzh_timecnt
|
1994-09-13 03:39:01 +00:00
|
|
|
is zero or the time argument is less than the first transition time recorded
|
|
|
|
in the file.
|
1994-09-13 21:26:08 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ctime 3 ,
|
|
|
|
.Xr time2posix 3 ,
|
|
|
|
.Xr zic 8
|
1994-09-13 03:39:01 +00:00
|
|
|
.\" @(#)tzfile.5 7.2
|