1*62585Sbostic.\" Copyright (c) 1991, 1993 2*62585Sbostic.\" The Regents of the University of California. All rights reserved. 348425Sbostic.\" 448425Sbostic.\" This code is derived from software contributed to Berkeley by 548425Sbostic.\" Arthur David Olson of the National Cancer Institute. 649652Scael.\" modification, are permitted provided that the following conditions 749652Scael.\" are met: 848425Sbostic.\" 950480Scael.\" %sccs.include.redist.roff% 1048425Sbostic.\" 11*62585Sbostic.\" @(#)tzfile.5 8.1 (Berkeley) 06/08/93 1248425Sbostic.\" 1349652Scael.Dd 1449652Scael.Dt TZFILE 5 1550480Scael.Os 1649652Scael.Sh NAME 1749652Scael.Nm tzfile 1849652Scael.Nd time zone information 1949652Scael.Sh SYNOPSIS 2049652Scael.Fd #include <tzfile.h> 2149652Scael.Sh DESCRIPTION 2239988SbosticThe time zone information files used by 2349652Scael.Xr tzset 3 2439988Sbosticbegin with bytes reserved for future use, 2539988Sbosticfollowed by four four-byte values of type 2649652Scael.Em long , 2739988Sbosticwritten in a ``standard'' byte order 2839988Sbostic(the high-order byte of the value is written first). 2939988SbosticThese values are, 3039988Sbosticin order: 3149652Scael.Bl -tag -width tzh_ttisstdcnt 3249652Scael.It Fa tzh_ttisstdcnt 3339988SbosticThe number of standard/wall indicators stored in the file. 3449652Scael.It Fa tzh_leapcnt 3539988SbosticThe number of leap seconds for which data is stored in the file. 3649652Scael.It Fa tzh_timecnt 3739988SbosticThe number of "transition times" for which data is stored 3839988Sbosticin the file. 3949652Scael.It Fa tzh_typecnt 4039988SbosticThe number of "local time types" for which data is stored 4139988Sbosticin the file (must not be zero). 4249652Scael.It Fa tzh_charcnt 4339988SbosticThe number of characters of "time zone abbreviation strings" 4439988Sbosticstored in the file. 4549652Scael.El 4649652Scael.Pp 4739988SbosticThe above header is followed by 4849652Scael.Fa tzh_timecnt 4939988Sbosticfour-byte values of type 5049652Scael.Em long , 5139988Sbosticsorted in ascending order. 5239988SbosticThese values are written in ``standard'' byte order. 5339988SbosticEach is used as a transition time (as returned by 5449652Scael.Xr time 2 ) 5539988Sbosticat which the rules for computing local time change. 5639988SbosticNext come 5749652Scael.Fa tzh_timecnt 5839988Sbosticone-byte values of type 5949652Scael.Fa unsigned char ; 6039988Sbosticeach one tells which of the different types of ``local time'' types 6139988Sbosticdescribed in the file is associated with the same-indexed transition time. 6239988SbosticThese values serve as indices into an array of 6349652Scael.Fa ttinfo 6439988Sbosticstructures that appears next in the file; 6539988Sbosticthese structures are defined as follows: 6649652Scael.Bd -literal -offset indent 6739988Sbosticstruct ttinfo { 6839988Sbostic long tt_gmtoff; 6939988Sbostic int tt_isdst; 7039988Sbostic unsigned int tt_abbrind; 7139988Sbostic}; 7249652Scael.Ed 7349652Scael.Pp 7439988SbosticEach structure is written as a four-byte value for 7549652Scael.Fa tt_gmtoff 7639988Sbosticof type 7749652Scael.Em long , 7839988Sbosticin a standard byte order, followed by a one-byte value for 7949652Scael.Fa tt_isdst 8039988Sbosticand a one-byte value for 8149652Scael.Fa tt_abbrind . 8239988SbosticIn each structure, 8349652Scael.Fa tt_gmtoff 8450480Scaelgives the number of seconds to be added to 8550480Scael.Tn GMT , 8649652Scael.Fa tt_isdst 8739988Sbostictells whether 8849652Scael.Fa tm_isdst 8939988Sbosticshould be set by 9049652Scael.Xr localtime 3 9139988Sbosticand 9249652Scael.Fa tt_abbrind 9339988Sbosticserves as an index into the array of time zone abbreviation characters 9439988Sbosticthat follow the 9549652Scael.Fa ttinfo 9639988Sbosticstructure(s) in the file. 9749652Scael.Pp 9839988SbosticThen there are 9949652Scael.Fa tzh_leapcnt 10039988Sbosticpairs of four-byte values, written in standard byte order; 10139988Sbosticthe first value of each pair gives the time 10239988Sbostic(as returned by 10349652Scael.Xr time 2 ) 10439988Sbosticat which a leap second occurs; 10539988Sbosticthe second gives the 10649652Scael.Em total 10739988Sbosticnumber of leap seconds to be applied after the given time. 10839988SbosticThe pairs of values are sorted in ascending order by time. 10949652Scael.Pp 11039988SbosticFinally there are 11149652Scael.Fa tzh_ttisstdcnt 11239988Sbosticstandard/wall indicators, each stored as a one-byte value; 11339988Sbosticthey tell whether the transition times associated with local time types 11439988Sbosticwere specified as standard time or wall clock time, 11549652Scaeland are used when a time zone file is used in handling 11649652Scael.Tn POSIX Ns -style 11739988Sbostictime zone environment variables. 11849652Scael.Pp 11949652Scael.Fa Localtime 12039988Sbosticuses the first standard-time 12149652Scael.Fa ttinfo 12239988Sbosticstructure in the file 12339988Sbostic(or simply the first 12449652Scael.Fa ttinfo 12539988Sbosticstructure in the absence of a standard-time structure) 12639988Sbosticif either 12749652Scael.Fa tzh_timecnt 12839988Sbosticis zero or the time argument is less than the first transition time recorded 12939988Sbosticin the file. 13049652Scael.Sh SEE ALSO 13149652Scael.Xr ctime 3 13249652Scael.Sh HISTORY 13349652ScaelThe 13449652Scael.Nm tzfile 13549652Scaelfile format appeared in 13649652Scael.Bx 4.3 tahoe. 137