| 1.\" $Id: tzfile.5,v 1.6 1999/01/20 18:54:12 wollman Exp $
|
1.Dd September 13, 1994 2.Dt TZFILE 5
| 2.Dd September 13, 1994 3.Dt TZFILE 5
|
3.Os FreeBSD 2.0
| 4.Os FreeBSD 3.0
|
4.Sh NAME 5.Nm tzfile 6.Nd timezone information 7.Sh SYNOPSIS
| 5.Sh NAME 6.Nm tzfile 7.Nd timezone information 8.Sh SYNOPSIS
|
8.Fd #include <tzfile.h>
| 9.Fd #include "/usr/src/lib/libc/stdtime/tzfile.h"
|
9.Sh DESCRIPTION 10The time zone information files used by 11.Xr tzset 3
| 10.Sh DESCRIPTION 11The time zone information files used by 12.Xr tzset 3
|
12begin with bytes reserved for future use,
| 13begin with the magic characters 14.Dq Li TZif 15to identify them as 16time zone information files, 17followed by sixteen bytes reserved for future use,
|
13followed by four four-byte values 14written in a ``standard'' byte order 15(the high-order byte of the value is written first). 16These values are, 17in order: 18.Pp 19.Bl -tag -compact -width tzh_ttisstdcnt
| 18followed by four four-byte values 19written in a ``standard'' byte order 20(the high-order byte of the value is written first). 21These values are, 22in order: 23.Pp 24.Bl -tag -compact -width tzh_ttisstdcnt
|
20.It Li tzh_ttisstdcnt
| 25.It Va tzh_ttisgmtcnt 26The number of UTC/local indicators stored in the file. 27.It Va tzh_ttisstdcnt
|
21The number of standard/wall indicators stored in the file.
| 28The number of standard/wall indicators stored in the file.
|
22.It Li tzh_leapcnt
| 29.It Va tzh_leapcnt
|
23The number of leap seconds for which data is stored in the file.
| 30The number of leap seconds for which data is stored in the file.
|
24.It Li tzh_timecnt
| 31.It Va tzh_timecnt
|
25The number of ``transition times'' for which data is stored 26in the file.
| 32The number of ``transition times'' for which data is stored 33in the file.
|
27.It Li tzh_typecnt
| 34.It Va tzh_typecnt
|
28The number of ``local time types'' for which data is stored 29in the file (must not be zero).
| 35The number of ``local time types'' for which data is stored 36in the file (must not be zero).
|
30.It Li tzh_charcnt
| 37.It Va tzh_charcnt
|
31The number of characters of ``time zone abbreviation strings'' 32stored in the file. 33.El 34.Pp 35The above header is followed by
| 38The number of characters of ``time zone abbreviation strings'' 39stored in the file. 40.El 41.Pp 42The above header is followed by
|
36.Li tzh_timecnt
| 43.Va tzh_timecnt
|
37four-byte values of type 38.Fa long , 39sorted in ascending order. 40These values are written in ``standard'' byte order. 41Each is used as a transition time (as returned by 42.Xr time 3 ) 43at which the rules for computing local time change. 44Next come
| 44four-byte values of type 45.Fa long , 46sorted in ascending order. 47These values are written in ``standard'' byte order. 48Each is used as a transition time (as returned by 49.Xr time 3 ) 50at which the rules for computing local time change. 51Next come
|
45.Li tzh_timecnt
| 52.Va tzh_timecnt
|
46one-byte values of type 47.Fa "unsigned char" ; 48each one tells which of the different types of ``local time'' types 49described in the file is associated with the same-indexed transition time. 50These values serve as indices into an array of 51.Fa ttinfo 52structures that appears next in the file; 53these structures are defined as follows: 54.Pp 55.Bd -literal -offset indent 56struct ttinfo { 57 long tt_gmtoff; 58 int tt_isdst; 59 unsigned int tt_abbrind; 60}; 61.Ed 62.Pp 63Each structure is written as a four-byte value for
| 53one-byte values of type 54.Fa "unsigned char" ; 55each one tells which of the different types of ``local time'' types 56described in the file is associated with the same-indexed transition time. 57These values serve as indices into an array of 58.Fa ttinfo 59structures that appears next in the file; 60these structures are defined as follows: 61.Pp 62.Bd -literal -offset indent 63struct ttinfo { 64 long tt_gmtoff; 65 int tt_isdst; 66 unsigned int tt_abbrind; 67}; 68.Ed 69.Pp 70Each structure is written as a four-byte value for
|
64.Li tt_gmtoff
| 71.Va tt_gmtoff
|
65of type 66.Fa long , 67in a standard byte order, followed by a one-byte value for
| 72of type 73.Fa long , 74in a standard byte order, followed by a one-byte value for
|
68.Li tt_isdst
| 75.Va tt_isdst
|
69and a one-byte value for
| 76and a one-byte value for
|
70.Li tt_abbrind .
| 77.Va tt_abbrind .
|
71In each structure,
| 78In each structure,
|
72.Li tt_gmtoff 73gives the number of seconds to be added to GMT,
| 79.Va tt_gmtoff 80gives the number of seconds to be added to UTC,
|
74.Li tt_isdst 75tells whether 76.Li tm_isdst 77should be set by 78.Xr localtime 3 79and
| 81.Li tt_isdst 82tells whether 83.Li tm_isdst 84should be set by 85.Xr localtime 3 86and
|
80.Li tt_abbrind
| 87.Va tt_abbrind
|
81serves as an index into the array of time zone abbreviation characters 82that follow the 83.Li ttinfo 84structure(s) in the file. 85.Pp 86Then there are
| 88serves as an index into the array of time zone abbreviation characters 89that follow the 90.Li ttinfo 91structure(s) in the file. 92.Pp 93Then there are
|
87.Li tzh_leapcnt
| 94.Va tzh_leapcnt
|
88pairs of four-byte values, written in standard byte order; 89the first value of each pair gives the time 90(as returned by 91.Xr time 3 ) 92at which a leap second occurs; 93the second gives the 94.Em total 95number of leap seconds to be applied after the given time. 96The pairs of values are sorted in ascending order by time. 97.Pp
| 95pairs of four-byte values, written in standard byte order; 96the first value of each pair gives the time 97(as returned by 98.Xr time 3 ) 99at which a leap second occurs; 100the second gives the 101.Em total 102number of leap seconds to be applied after the given time. 103The pairs of values are sorted in ascending order by time. 104.Pp
|
98Finally there are 99.Li tzh_ttisstdcnt
| 105Then there are 106.Va tzh_ttisstdcnt
|
100standard/wall indicators, each stored as a one-byte value; 101they tell whether the transition times associated with local time types 102were specified as standard time or wall clock time, 103and are used when a time zone file is used in handling POSIX-style 104time zone environment variables. 105.Pp
| 107standard/wall indicators, each stored as a one-byte value; 108they tell whether the transition times associated with local time types 109were specified as standard time or wall clock time, 110and are used when a time zone file is used in handling POSIX-style 111time zone environment variables. 112.Pp
|
| 113Finally there are 114.Va tzh_ttisgmtcnt 115UTC/local indicators, each stored as a one-byte value; 116they tell whether the transition times associated with local time types 117were specified as UTC or local time, 118and are used when a time zone file is used in handling POSIX-style 119time zone environment variables. 120.Pp
|
106.Nm localtime 107uses the first standard-time 108.Li ttinfo 109structure in the file 110(or simply the first 111.Li ttinfo 112structure in the absence of a standard-time structure) 113if either 114.Li tzh_timecnt 115is zero or the time argument is less than the first transition time recorded 116in the file. 117.Sh SEE ALSO 118.Xr ctime 3 , 119.Xr time2posix 3 , 120.Xr zic 8 121.\" @(#)tzfile.5 7.2
| 121.Nm localtime 122uses the first standard-time 123.Li ttinfo 124structure in the file 125(or simply the first 126.Li ttinfo 127structure in the absence of a standard-time structure) 128if either 129.Li tzh_timecnt 130is zero or the time argument is less than the first transition time recorded 131in the file. 132.Sh SEE ALSO 133.Xr ctime 3 , 134.Xr time2posix 3 , 135.Xr zic 8 136.\" @(#)tzfile.5 7.2
|
| 137.\" This file is in the public domain, so clarified as of 138.\" 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
|
| |