| 1 | .TH TZFILE 5 |
| 2 | .SH NAME |
| 3 | tzfile \- time zone information |
| 4 | .SH SYNOPSIS |
| 5 | .B |
| 6 | #include <tzfile.h> |
| 7 | .SH DESCRIPTION |
| 8 | The time zone information files used by |
| 9 | .IR tzset (3) |
| 10 | begin with bytes reserved for future use, |
| 11 | followed by four four-byte values of type |
| 12 | .BR long , |
| 13 | written in a ``standard'' byte order |
| 14 | (the high-order byte of the value is written first). |
| 15 | These values are, |
| 16 | in order: |
| 17 | .TP |
| 18 | .I tzh_ttisstdcnt |
| 19 | The number of standard/wall indicators stored in the file. |
| 20 | .TP |
| 21 | .I tzh_leapcnt |
| 22 | The number of leap seconds for which data is stored in the file. |
| 23 | .TP |
| 24 | .I tzh_timecnt |
| 25 | The number of "transition times" for which data is stored |
| 26 | in the file. |
| 27 | .TP |
| 28 | .I tzh_typecnt |
| 29 | The number of "local time types" for which data is stored |
| 30 | in the file (must not be zero). |
| 31 | .TP |
| 32 | .I tzh_charcnt |
| 33 | The number of characters of "time zone abbreviation strings" |
| 34 | stored in the file. |
| 35 | .PP |
| 36 | The above header is followed by |
| 37 | .I tzh_timecnt |
| 38 | four-byte values of type |
| 39 | .BR long , |
| 40 | sorted in ascending order. |
| 41 | These values are written in ``standard'' byte order. |
| 42 | Each is used as a transition time (as returned by |
| 43 | .IR time (2)) |
| 44 | at which the rules for computing local time change. |
| 45 | Next come |
| 46 | .I tzh_timecnt |
| 47 | one-byte values of type |
| 48 | .BR "unsigned char" ; |
| 49 | each one tells which of the different types of ``local time'' types |
| 50 | described in the file is associated with the same-indexed transition time. |
| 51 | These values serve as indices into an array of |
| 52 | .I ttinfo |
| 53 | structures that appears next in the file; |
| 54 | these structures are defined as follows: |
| 55 | .in +.5i |
| 56 | .sp |
| 57 | .nf |
| 58 | .ta .5i +\w'unsigned int\0\0'u |
| 59 | struct ttinfo { |
| 60 | long tt_gmtoff; |
| 61 | int tt_isdst; |
| 62 | unsigned int tt_abbrind; |
| 63 | }; |
| 64 | .in -.5i |
| 65 | .fi |
| 66 | .sp |
| 67 | Each structure is written as a four-byte value for |
| 68 | .I tt_gmtoff |
| 69 | of type |
| 70 | .BR long , |
| 71 | in a standard byte order, followed by a one-byte value for |
| 72 | .I tt_isdst |
| 73 | and a one-byte value for |
| 74 | .IR tt_abbrind . |
| 75 | In each structure, |
| 76 | .I tt_gmtoff |
| 77 | gives the number of seconds to be added to GMT, |
| 78 | .I tt_isdst |
| 79 | tells whether |
| 80 | .I tm_isdst |
| 81 | should be set by |
| 82 | .I localtime (3) |
| 83 | and |
| 84 | .I tt_abbrind |
| 85 | serves as an index into the array of time zone abbreviation characters |
| 86 | that follow the |
| 87 | .I ttinfo |
| 88 | structure(s) in the file. |
| 89 | .PP |
| 90 | Then there are |
| 91 | .I tzh_leapcnt |
| 92 | pairs of four-byte values, written in standard byte order; |
| 93 | the first value of each pair gives the time |
| 94 | (as returned by |
| 95 | .IR time(2)) |
| 96 | at which a leap second occurs; |
| 97 | the second gives the |
| 98 | .I total |
| 99 | number of leap seconds to be applied after the given time. |
| 100 | The pairs of values are sorted in ascending order by time. |
| 101 | .PP |
| 102 | Finally there are |
| 103 | .I tzh_ttisstdcnt |
| 104 | standard/wall indicators, each stored as a one-byte value; |
| 105 | they tell whether the transition times associated with local time types |
| 106 | were specified as standard time or wall clock time, |
| 107 | and are used when a time zone file is used in handling POSIX-style |
| 108 | time zone environment variables. |
| 109 | .PP |
| 110 | .I Localtime |
| 111 | uses the first standard-time |
| 112 | .I ttinfo |
| 113 | structure in the file |
| 114 | (or simply the first |
| 115 | .I ttinfo |
| 116 | structure in the absence of a standard-time structure) |
| 117 | if either |
| 118 | .I tzh_timecnt |
| 119 | is zero or the time argument is less than the first transition time recorded |
| 120 | in the file. |
| 121 | .SH SEE ALSO |
| 122 | newctime(3) |
| 123 | .\" @(#)tzfile.5 7.2 |