TZFILE(5) | File Formats Manual | TZFILE(5) |
tzfile
—
0
(false) or 1
(true).
NUL
, or “3”, or “4
).”struct ttinfo { int32_t tt_uttoff; unsigned char tt_isdst; unsigned char tt_desigind; };
Each structure is written as a four-byte signed integer
value for tt_gmtoff in a network byte order,
followed by a one-byte value for tt_isdst and
a one-byte value for tt_desigidx. In each
structure, tt_gmtoff gives the number of
seconds to be added to UT, tt_isdst tells
whether tm_isdst should be set by
localtime(3) and
tt_desigidx serves as an index into the array
of timezone abbreviation bytes that follow the
ttinfo structure(s) in the file. entries in
the file; if the designated string is “\*-00”, the
ttinfo entry is a placeholder indicating that
local time is unspecified. The tt_utoff +value
is never equal to -2**31, to let 32-bit clients negate it without
overflow. Also, in realistic applications
tt_utoff is in the range [-89999, 93599]
(i.e., more than -25 hours and less than 26 hours); this allows easy
support by implementations that already support the POSIX-required
range [-24:59:59
,
25:59:59
].
1
for a positive leap second, or
-1
for a negative leap second. If the leap
second table is empty, the leap-second correction is zero for all
timestamps; otherwise, for timestamps before the first occurrence
time, the leap-second correction is zero if the first pair's
correction is 1
or -1
,
and is unspecified otherwise (which can happen only in files truncated
at the start).The standard/wall and UT/local indicators were designed
for transforming a TZif file's transition times into transitions
appropriate for another time zone specified via a proleptic TZ
string that lacks rules. For example, when
TZ="EET2EEST"
and there is no TZif
file “EET2EEST”, the idea was to adapt the transition
times from a TZif file with the well-known name
"posixrules" that is present only for this purpose and is
a copy of the file “Europe/Brussels”, a file with a
different UT offset. POSIX does not specify the details of this
obsolete transformational behavior, the default rules are
installation-dependent, and no implementation is known to support
this feature for timestamps past 2037
, so
users desiring (say) Greek time should instead specify
TZ="Europe/Athens"
for better
historical coverage, falling back on
TZ="EET2EEST,M3.5.0/3,M10.5.0/4"
if POSIX conformance is required and older timestamps need not be
handled accurately.
The localtime(3) function normally uses the first ttinfo structure in the file if either tzh_timecnt is zero or the time argument is less than the first transition time recorded in the file.
+1
nor
-1
, to represent truncation of the TZif file at the
start. Also, if two or more leap second transitions are present and the last
entry's correction equals the previous one, the last entry denotes the
expiration of the leap second table instead of a leap second; timestamps after
this expiration are unreliable in that future releases will likely add leap
second entries after the expiration, and the added leap seconds will change
how post-expiration timestamps are treated.
The sequence of time changes defined by the version 1 header and
data block should be a contiguous sub-sequence of the time changes defined
by the version 2+ header and data block, and by the footer. This guideline
helps obsolescent version 1 readers agree with current readers about
timestamps within the contiguous sub-sequence. It also lets writers not
supporting obsolescent readers use a tzh_timecnt
of
zero in the version 1 data block to save space.
When a TZif file contains a leap second table expiration time, TZif readers should either refuse to process post-expiration timestamps, or process them as if the expiration time did not exist (possibly with an error indication).
Time zone designations should consist of at least three (3) and no more than six (6) ASCII characters from the set of alphanumerics, “-”, and “+”. This is for compatibility with POSIX requirements for time zone abbreviations.
When reading a version 2 or higher file, readers should ignore the version 1 header and data block except for the purpose of skipping over them.
Readers should calculate the total lengths of the headers and data blocks and check that they all fit within the actual file size, as part of a validity check for the file.
When a positive leap second occurs, readers should append an extra second to the local minute containing the second just before the leap second. If this occurs when the UTC offset is not a multiple of 60 seconds, the leap second occurs earlier than the last second of the local minute and the minute's remaining local seconds are numbered through 60 instead of the usual 59; the UTC offset is unaffected.
+When new versions of the TZif format have been defined, a design goal has been that a reader can successfully use a TZif file even if the file is of a later TZif version than what the reader was designed for. When complete compatibility was not achieved, an attempt was made to limit glitches to rarely used timestamps and allow simple partial workarounds in writers designed to generate newer-version data useful even for older-version readers. This section attempts to document these compatibility issues and workarounds, as well as to document other common bugs in readers.
Interoperability problems with TZif include the following:
Many readers mishandle time zone abbreviations that contain non-ASCII characters. These characters are not recommended.
Some readers may mishandle time zone abbreviations that contain fewer than 3 or more than 6 characters or that contain ASCII characters other than alphanumerics, “-”. and “+”. These abbreviations are not recommended.
Some interoperability problems are reader bugs that are listed here mostly as warnings to developers of readers.
%U https://www.rfc-editor.org/rfc/rfc9636 %U https://doi.org/10.17487/RFC9536 %R RFC 9536 Olson A, Eggert P, Murchison K., The Time Zone Information Format (TZif)., October 2024..
September 10, 2024 | NetBSD 10.99 |