Internet Engineering Task Force (IETF)                          A. Olson
Request for Comments: 8536
Category: Standards Track                                      P. Eggert
ISSN: 2070-1721                                                     UCLA
                                                            K. Murchison
                                                                FastMail
                                                           February 2019
        
Internet Engineering Task Force (IETF)                          A. Olson
Request for Comments: 8536
Category: Standards Track                                      P. Eggert
ISSN: 2070-1721                                                     UCLA
                                                            K. Murchison
                                                                FastMail
                                                           February 2019
        

The Time Zone Information Format (TZif)

时区信息格式(TZif)

Abstract

摘要

This document specifies the Time Zone Information Format (TZif) for representing and exchanging time zone information, independent of any particular service or protocol. Two media types for this format are also defined.

本文件规定了时区信息格式(TZif),用于表示和交换时区信息,与任何特定服务或协议无关。还定义了此格式的两种媒体类型。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 7841第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8536.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问https://www.rfc-editor.org/info/rfc8536.

Copyright Notice

版权公告

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.

版权(c)2019 IETF信托基金和被确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(https://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  The Time Zone Information Format (TZif) . . . . . . . . . . .   5
     3.1.  TZif Header . . . . . . . . . . . . . . . . . . . . . . .   6
     3.2.  TZif Data Block . . . . . . . . . . . . . . . . . . . . .   8
     3.3.  TZif Footer . . . . . . . . . . . . . . . . . . . . . . .  12
       3.3.1.  TZ String Extensions  . . . . . . . . . . . . . . . .  13
   4.  Interoperability Considerations . . . . . . . . . . . . . . .  13
   5.  Use with the Time Zone Data Distribution Service  . . . . . .  14
     5.1.  Truncating TZif Files . . . . . . . . . . . . . . . . . .  15
     5.2.  Example TZDIST Request for TZif Data  . . . . . . . . . .  15
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  17
   7.  Privacy Considerations  . . . . . . . . . . . . . . . . . . .  17
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  17
     8.1.  application/tzif  . . . . . . . . . . . . . . . . . . . .  17
     8.2.  application/tzif-leap . . . . . . . . . . . . . . . . . .  18
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  19
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  19
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  20
   Appendix A.  Common Interoperability Issues . . . . . . . . . . .  21
   Appendix B.  Example TZif Files . . . . . . . . . . . . . . . . .  23
     B.1.  Version 1 File Representing UTC (with Leap Seconds) . . .  24
     B.2.  Version 2 File Representing Pacific/Honolulu  . . . . . .  28
     B.3.  Truncated Version 3 File Representing Asia/Jerusalem  . .  33
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  34
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  34
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  The Time Zone Information Format (TZif) . . . . . . . . . . .   5
     3.1.  TZif Header . . . . . . . . . . . . . . . . . . . . . . .   6
     3.2.  TZif Data Block . . . . . . . . . . . . . . . . . . . . .   8
     3.3.  TZif Footer . . . . . . . . . . . . . . . . . . . . . . .  12
       3.3.1.  TZ String Extensions  . . . . . . . . . . . . . . . .  13
   4.  Interoperability Considerations . . . . . . . . . . . . . . .  13
   5.  Use with the Time Zone Data Distribution Service  . . . . . .  14
     5.1.  Truncating TZif Files . . . . . . . . . . . . . . . . . .  15
     5.2.  Example TZDIST Request for TZif Data  . . . . . . . . . .  15
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  17
   7.  Privacy Considerations  . . . . . . . . . . . . . . . . . . .  17
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  17
     8.1.  application/tzif  . . . . . . . . . . . . . . . . . . . .  17
     8.2.  application/tzif-leap . . . . . . . . . . . . . . . . . .  18
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  19
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  19
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  20
   Appendix A.  Common Interoperability Issues . . . . . . . . . . .  21
   Appendix B.  Example TZif Files . . . . . . . . . . . . . . . . .  23
     B.1.  Version 1 File Representing UTC (with Leap Seconds) . . .  24
     B.2.  Version 2 File Representing Pacific/Honolulu  . . . . . .  28
     B.3.  Truncated Version 3 File Representing Asia/Jerusalem  . .  33
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  34
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  34
        
1. Introduction
1. 介绍

Time zone data typically consists of offsets from universal time (UT), daylight saving transition rules, one or more local time designations (acronyms or abbreviations), and optional leap-second adjustments. One such format for conveying this information is iCalendar [RFC5545]. It is a text-based format used by calendaring and scheduling systems.

时区数据通常包括与世界时(UT)的偏移、夏令时转换规则、一个或多个本地时间名称(首字母缩写或缩写)以及可选的闰秒调整。用于传达此信息的一种格式是iCalendar[RFC5545]。它是日历和日程安排系统使用的基于文本的格式。

This document specifies the widely deployed Time Zone Information Format (TZif). It is a binary format used by most UNIX systems to calculate local time. This format was introduced in the 1980s and has evolved since then into multiple upward-compatible versions. There is a wide variety of interoperable software capable of generating and reading files in this format [tz-link].

本文件规定了广泛部署的时区信息格式(TZif)。它是大多数UNIX系统用于计算本地时间的二进制格式。该格式于20世纪80年代引入,并从那时起发展为多个向上兼容的版本。有多种可互操作的软件能够生成和读取这种格式的文件[tz link]。

This specification does not define the source of the data assembled into a TZif file. One such source is the IANA-hosted time zone database [RFC6557].

本规范未定义组装到TZif文件中的数据源。其中一个来源是IANA托管的时区数据库[RFC6557]。

2. Conventions Used in This Document
2. 本文件中使用的公约

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”在所有大写字母出现时(如图所示)应按照BCP 14[RFC2119][RFC8174]所述进行解释。

The following terms are used in this document (see "Sources for Time Zone and Daylight Saving Time Data" [tz-link] for more detailed information about civil timekeeping data and practice):

本文件中使用了以下术语(有关民用计时数据和实践的更多详细信息,请参见“时区和夏令时数据来源”[tz链接]):

Coordinated Universal Time (UTC): The basis for civil time since 1960. It is approximately equal to mean solar time at the prime meridian (0 degrees longitude).

协调世界时(UTC):1960年以来的民用时间基础。它大约等于本初子午线(0度经度)的平均太阳时间。

Daylight Saving Time (DST): The time according to a location's law or practice, when adjusted as necessary from standard time. The adjustment may be positive or negative, and the amount of adjustment may vary depending on the date and time; the TZif format even allows the adjustment to be zero, although this is not common practice.

夏令时(DST):根据某一地点的法律或惯例,根据标准时间进行必要调整的时间。调整可能是积极的,也可能是消极的,调整的金额可能因日期和时间而异;TZif格式甚至允许调整为零,尽管这不是常见做法。

International Atomic Time (TAI): The time standard based on atomic clocks since 1972. It is equal to UTC but without leap-second adjustments.

国际原子时(TAI):自1972年以来基于原子钟的时间标准。它等于UTC,但没有闰秒调整。

Leap-Second Correction (LEAPCORR): The value of TAI - UTC - 10 for timestamps after the first leap second, and zero for timestamps before that. The expression "TAI - UTC - 10" comes from the fact that TAI - UTC was defined to be 10 just prior to the first leap second in 1972, so clocks with leap seconds have a zero LEAPCORR before the first leap second.

闰秒校正(LEAPCORR):第一个闰秒之后的时间戳的TAI-UTC-10值,第一个闰秒之前的时间戳的TAI-UTC-10值为零。表达式“TAI-UTC-10”源于这样一个事实,即TAI-UTC在1972年第一个闰秒之前定义为10,因此具有闰秒的时钟在第一个闰秒之前具有零LEAPCORR。

Local Time: Civil time for a particular location. Its offset from universal time can depend on the date and time of day.

当地时间:特定地点的民用时间。它与世界时的偏移量取决于一天中的日期和时间。

POSIX Epoch: 1970-01-01 00:00:00 UTC, the basis for absolute timestamps in this document.

POSIX Epoch:1970-01-01 00:00:00 UTC,本文档中绝对时间戳的基础。

Standard Time: The time according to a location's law or practice, unadjusted for Daylight Saving Time.

标准时间:根据某一地点的法律或惯例,未调整为夏令时的时间。

Time Change: A change to civil timekeeping practice. It occurs when one or more of the following happen simultaneously:

时间变更:对民事计时惯例的变更。当下列一个或多个事件同时发生时发生:

1. a change in UT offset

1. UT偏移量的变化

2. a change in whether daylight saving time is in effect

2. 夏令时是否生效的更改

3. a change in time zone abbreviation

3. 时区缩写的变化

4. a leap second (i.e., a change in LEAPCORR)

4. 闰秒(即闰秒的变化)

Time Zone Data: The Time Zone Data Distribution Service (TZDIST) [RFC7808] defines "Time zone data" as "data that defines a single time zone, including an identifier, UTC offset values, DST rules, and other information such as time zone abbreviations." The interchange format defined in this document is one such form of time zone data.

时区数据:时区数据分发服务(TZDIST)[RFC7808]将“时区数据”定义为“定义单个时区的数据,包括标识符、UTC偏移值、DST规则和其他信息,如时区缩写。”本文档中定义的交换格式就是这样一种形式的时区数据。

Transition Time: The moment of occurrence of a time change that is not a leap second. It is identified with a signed integer count of UNIX leap time seconds since the POSIX epoch.

过渡时间:非闰秒的时间变化发生的时刻。它由自POSIX纪元以来UNIX跳跃时间秒的有符号整数计数标识。

Universal Time (UT): The basis of civil time. This is the principal form of the mean solar time at the prime meridian (0 degrees longitude) for timestamps before UTC was introduced in 1960 and is UTC for timestamps thereafter. Although UT is sometimes called "UTC" or "GMT" in other sources, this specification uses the term "UT" to avoid confusion with UTC or with GMT.

世界时间(UT):民用时间的基础。这是1960年引入UTC之前时间戳在本初子午线(0度经度)处的平均太阳时间的主要形式,此后时间戳为UTC。虽然UT有时在其他来源中被称为“UTC”或“GMT”,但本规范使用术语“UT”以避免与UTC或GMT混淆。

UNIX Time: The time as returned by the time() function provided by the C programming language (see Section 3 of the "System Interfaces" volume of [POSIX]). This is an integer number of seconds since the POSIX epoch, not counting leap seconds. As an extension to POSIX, negative values represent times before the POSIX epoch, using UT.

UNIX时间:由C编程语言提供的Time()函数返回的时间(参见[POSIX]卷“系统接口”第3节)。这是自POSIX历元以来的整数秒数,不包括闰秒。作为POSIX的扩展,负值表示POSIX纪元之前的时间,使用UT。

UNIX Leap Time: UNIX time plus all preceding leap-second corrections. For example, if the first leap-second record in a TZif file occurs at 1972-06-30 23:59:60 UTC, the UNIX leap time for the timestamp 1972-07-01 00:00:00 UTC would be 78796801, one greater than the UNIX time for the same timestamp. Similarly, if the second leap-second record occurs at 1972-12-31 23:59:60 UTC, it accounts for the first leap second, so the UNIX leap time of 1972-12-31 23:59:60 UTC would be 94694401, and the UNIX leap time of 1973-01-01 00:00:00 UTC would be 94694402. If a TZif file specifies no leap-second records, UNIX leap time is equal to UNIX time.

UNIX跳跃时间:UNIX时间加上之前所有的跳跃秒修正。例如,如果TZif文件中的第一个闰秒记录发生在1972-06-30 23:59:60 UTC,则时间戳1972-07-01 00:00:00 UTC的UNIX闰秒时间将为78796801,比相同时间戳的UNIX时间大一个。类似地,如果第二个闰秒记录发生在1972-12-31 23:59:60 UTC,则它将记录第一个闰秒,因此1972-12-31 23:59:60 UTC的UNIX闰秒时间将为94694401,1973-01-01 00:00:00 UTC的UNIX闰秒时间将为94694402。如果TZif文件未指定闰秒记录,则UNIX闰秒等于UNIX时间。

Wall Time: Another name for local time; short for "wall-clock time".

墙时间:当地时间的另一个名称;“挂钟时间”的缩写。

3. The Time Zone Information Format (TZif)
3. 时区信息格式(TZif)

The Time Zone Information Format begins with a fixed 44-octet version 1 header (Section 3.1) containing a field that specifies the version of the file's format. Readers designed for version N can read version N+1 files without too much trouble; data specific to version N+1 either appears after version N data so that earlier-version readers can easily ignore later-version data they are not designed for, or it appears as a minor extension to version N that version N readers are likely to tolerate well.

时区信息格式以一个固定的44八位字节版本1头(第3.1节)开始,其中包含一个指定文件格式版本的字段。为N版设计的读卡器可以轻松地读取N+1版文件;版本N+1的特定数据要么出现在版本N数据之后,以便早期版本的读者可以轻松忽略其未设计的后期版本数据,要么作为版本N的次要扩展,版本N的读者可能会很好地容忍。

The version 1 header is followed by a variable-length version 1 data block (Section 3.2) containing four-octet (32-bit) transition times and leap-second occurrences. These 32-bit values are limited to representing time changes from 1901-12-13 20:45:52 through 2038-01-19 03:14:07 UT, and the version 1 header and data block are present only for backward compatibility with obsolescent readers, as discussed in Common Interoperability Issues (Appendix A).

版本1标头后面是可变长度的版本1数据块(第3.2节),其中包含四个八位组(32位)转换时间和闰秒。这些32位值仅限于表示从1901-12-13 20:45:52到2038-01-19 03:14:07 UT的时间变化,版本1标头和数据块仅用于与过时读取器的向后兼容性,如常见互操作性问题(附录A)中所述。

Version 1 files terminate after the version 1 data block. Files from versions 2 and 3 extend the format by appending a second 44-octet version 2+ header, a variable-length version 2+ data block containing eight-octet (64-bit) transition times and leap-second occurrences, and a variable-length footer (Section 3.3). These 64-bit values can represent times approximately 292 billion years into the past or future.

版本1文件在版本1数据块之后终止。版本2和版本3中的文件通过附加第二个44八位字节版本2+标头、包含八个八位字节(64位)转换时间和闰秒出现次数的可变长度版本2+数据块以及可变长度页脚来扩展格式(第3.3节)。这些64位值可以表示过去或未来大约2920亿年的时间。

NOTE: All multi-octet integer values MUST be stored in network octet order format (high-order octet first, otherwise known as big-endian), with all bits significant. Signed integer values MUST be represented using two's complement.

注意:所有多个八位字节整数值必须以网络八位字节顺序格式(高阶八位字节优先,否则称为big-endian)存储,所有位均为有效位。有符号整数值必须使用2的补码表示。

A TZif file is structured as follows:

TZif文件的结构如下所示:

                        Version 1       Versions 2 & 3
                     +-------------+   +-------------+
                     |  Version 1  |   |  Version 1  |
                     |   Header    |   |   Header    |
                     +-------------+   +-------------+
                     |  Version 1  |   |  Version 1  |
                     |  Data Block |   |  Data Block |
                     +-------------+   +-------------+
                                       |  Version 2+ |
                                       |   Header    |
                                       +-------------+
                                       |  Version 2+ |
                                       |  Data Block |
                                       +-------------+
                                       |   Footer    |
                                       +-------------+
        
                        Version 1       Versions 2 & 3
                     +-------------+   +-------------+
                     |  Version 1  |   |  Version 1  |
                     |   Header    |   |   Header    |
                     +-------------+   +-------------+
                     |  Version 1  |   |  Version 1  |
                     |  Data Block |   |  Data Block |
                     +-------------+   +-------------+
                                       |  Version 2+ |
                                       |   Header    |
                                       +-------------+
                                       |  Version 2+ |
                                       |  Data Block |
                                       +-------------+
                                       |   Footer    |
                                       +-------------+
        

General Format of TZif Files

TZif文件的通用格式

3.1. TZif Header
3.1. TZif头

A TZif header is structured as follows (the lengths of multi-octet fields are shown in parentheses):

TZif头的结构如下(多个八位字段的长度显示在括号中):

       +---------------+---+
       |  magic    (4) |ver|
       +---------------+---+---------------------------------------+
       |           [unused - reserved for future use] (15)         |
       +---------------+---------------+---------------+-----------+
       |  isutcnt  (4) |  isstdcnt (4) |  leapcnt  (4) |
       +---------------+---------------+---------------+
       |  timecnt  (4) |  typecnt  (4) |  charcnt  (4) |
       +---------------+---------------+---------------+
        
       +---------------+---+
       |  magic    (4) |ver|
       +---------------+---+---------------------------------------+
       |           [unused - reserved for future use] (15)         |
       +---------------+---------------+---------------+-----------+
       |  isutcnt  (4) |  isstdcnt (4) |  leapcnt  (4) |
       +---------------+---------------+---------------+
       |  timecnt  (4) |  typecnt  (4) |  charcnt  (4) |
       +---------------+---------------+---------------+
        

TZif Header

TZif头

The fields of the header are defined as follows:

标题的字段定义如下:

magic: The four-octet ASCII [RFC20] sequence "TZif" (0x54 0x5A 0x69 0x66), which identifies the file as utilizing the Time Zone Information Format.

魔术:四个八位ASCII[RFC20]序列“TZif”(0x54 0x5A 0x69 0x66),它将文件标识为使用时区信息格式。

ver(sion): An octet identifying the version of the file's format. The value MUST be one of the following:

版本(sion):标识文件格式版本的八位字节。该值必须是以下值之一:

NUL (0x00) Version 1 - The file contains only the version 1 header and data block. Version 1 files MUST NOT contain a version 2+ header, data block, or footer.

NUL(0x00)版本1-该文件仅包含版本1标头和数据块。版本1文件不得包含版本2+的页眉、数据块或页脚。

'2' (0x32) Version 2 - The file MUST contain the version 1 header and data block, a version 2+ header and data block, and a footer. The TZ string in the footer (Section 3.3), if nonempty, MUST strictly adhere to the requirements for the TZ environment variable as defined in Section 8.3 of the "Base Definitions" volume of [POSIX] and MUST encode the POSIX portable character set as ASCII.

“2”(0x32)版本2-文件必须包含版本1页眉和数据块、版本2+页眉和数据块以及页脚。页脚中的TZ字符串(第3.3节)如果非空,必须严格遵守[POSIX]的“基本定义”卷第8.3节中定义的TZ环境变量要求,并且必须将POSIX可移植字符集编码为ASCII。

'3' (0x33) Version 3 - The file MUST contain the version 1 header and data block, a version 2+ header and data block, and a footer. The TZ string in the footer (Section 3.3), if nonempty, MUST conform to POSIX requirements with ASCII encoding, except that it MAY use the TZ string extensions described below (Section 3.3.1).

“3”(0x33)版本3-文件必须包含版本1页眉和数据块、版本2+页眉和数据块以及页脚。页脚中的TZ字符串(第3.3节)如果不是空的,则必须符合POSIX对ASCII编码的要求,除非它可以使用下面描述的TZ字符串扩展名(第3.3.1节)。

isutcnt: A four-octet unsigned integer specifying the number of UT/ local indicators contained in the data block -- MUST either be zero or equal to "typecnt".

isutcnt:一个四个八位无符号整数,指定数据块中包含的UT/本地指示符的数量——必须为零或等于“typecnt”。

isstdcnt: A four-octet unsigned integer specifying the number of standard/wall indicators contained in the data block -- MUST either be zero or equal to "typecnt".

isstdcnt:一个四个八位无符号整数,指定数据块中包含的标准/墙指示器的数量——必须为零或等于“typecnt”。

leapcnt: A four-octet unsigned integer specifying the number of leap-second records contained in the data block.

leapcnt:一个四个八位无符号整数,指定数据块中包含的闰秒记录数。

timecnt: A four-octet unsigned integer specifying the number of transition times contained in the data block.

timecnt:一个四个八位无符号整数,指定数据块中包含的转换次数。

typecnt: A four-octet unsigned integer specifying the number of local time type records contained in the data block -- MUST NOT be zero. (Although local time type records convey no useful information in files that have nonempty TZ strings but no transitions, at least one such record is nevertheless required because many TZif readers reject files that have zero time types.)

typecnt:一个四个八位无符号整数,指定数据块中包含的本地时间类型记录的数量——不能为零。(虽然本地时间类型记录在具有非空TZ字符串但没有转换的文件中不传递任何有用信息,但至少需要一条这样的记录,因为许多TZif读取器拒绝具有零时间类型的文件。)

charcnt: A four-octet unsigned integer specifying the total number of octets used by the set of time zone designations contained in the data block - MUST NOT be zero. The count includes the trailing NUL (0x00) octet at the end of the last time zone designation.

charcnt:一个四个八位字节的无符号整数,指定数据块中包含的一组时区指定所使用的八位字节总数-不得为零。计数包括最后一个时区指定末尾的尾随NUL(0x00)八位字节。

Although the version 1 and 2+ headers have the same format, magic number, and version fields, their count fields may differ, because the version 1 data can be a subset of the version 2+ data.

尽管版本1和版本2+标题具有相同的格式、幻数和版本字段,但它们的计数字段可能不同,因为版本1数据可以是版本2+数据的子集。

3.2. TZif Data Block
3.2. TZif数据块

A TZif data block consists of seven variable-length elements, each of which is a series of items. The number of items in each series is determined by the corresponding count field in the header. The total length of each element is calculated by multiplying the number of items by the size of each item. Therefore, implementations that do not wish to parse or use the version 1 data block can calculate its total length and skip directly to the header of the version 2+ data block.

TZif数据块由七个可变长度元素组成,每个元素都是一系列项。每个系列中的项目数由标题中相应的计数字段确定。通过将项目数量乘以每个项目的大小来计算每个元素的总长度。因此,不希望解析或使用版本1数据块的实现可以计算其总长度,并直接跳到版本2+数据块的头部。

In the version 1 data block, time values are 32 bits (TIME_SIZE = 4 octets). In the version 2+ data block, present only in version 2 and 3 files, time values are 64 bits (TIME_SIZE = 8 octets).

在版本1数据块中,时间值为32位(时间大小=4个八位字节)。在版本2+数据块中,仅在版本2和版本3文件中出现,时间值为64位(时间大小=8个八位字节)。

The data block is structured as follows (the lengths of multi-octet fields are shown in parentheses):

数据块的结构如下(多个八位字节字段的长度显示在括号中):

        +---------------------------------------------------------+
        |  transition times          (timecnt x TIME_SIZE)        |
        +---------------------------------------------------------+
        |  transition types          (timecnt)                    |
        +---------------------------------------------------------+
        |  local time type records   (typecnt x 6)                |
        +---------------------------------------------------------+
        |  time zone designations    (charcnt)                    |
        +---------------------------------------------------------+
        |  leap-second records       (leapcnt x (TIME_SIZE + 4))  |
        +---------------------------------------------------------+
        |  standard/wall indicators  (isstdcnt)                   |
        +---------------------------------------------------------+
        |  UT/local indicators       (isutcnt)                    |
        +---------------------------------------------------------+
        
        +---------------------------------------------------------+
        |  transition times          (timecnt x TIME_SIZE)        |
        +---------------------------------------------------------+
        |  transition types          (timecnt)                    |
        +---------------------------------------------------------+
        |  local time type records   (typecnt x 6)                |
        +---------------------------------------------------------+
        |  time zone designations    (charcnt)                    |
        +---------------------------------------------------------+
        |  leap-second records       (leapcnt x (TIME_SIZE + 4))  |
        +---------------------------------------------------------+
        |  standard/wall indicators  (isstdcnt)                   |
        +---------------------------------------------------------+
        |  UT/local indicators       (isutcnt)                    |
        +---------------------------------------------------------+
        

TZif Data Block

TZif数据块

The elements of the data block are defined as follows:

数据块的元素定义如下:

transition times: A series of four- or eight-octet UNIX leap-time values sorted in strictly ascending order. Each value is used as a transition time at which the rules for computing local time may change. The number of time values is specified by the "timecnt" field in the header. Each time value SHOULD be at least -2**59.

过渡时间:按严格升序排序的一系列四个或八个八位字节的UNIX闰时间值。每个值都用作过渡时间,计算本地时间的规则可能会在该时间更改。时间值的数量由标头中的“timecnt”字段指定。每个时间值应至少为-2**59。

(-2**59 is the greatest negated power of 2 that predates the Big Bang, and avoiding earlier timestamps works around known TZif reader bugs relating to outlandishly negative timestamps.)

(-2**59是宇宙大爆炸之前最大的否定幂,避免更早的时间戳可以解决已知的TZif阅读器错误,这些错误与奇怪的否定时间戳有关。)

transition types: A series of one-octet unsigned integers specifying the type of local time of the corresponding transition time. These values serve as zero-based indices into the array of local time type records. The number of type indices is specified by the "timecnt" field in the header. Each type index MUST be in the range [0, "typecnt" - 1].

转换类型:一系列一个八位无符号整数,指定相应转换时间的本地时间类型。这些值用作本地时间类型记录数组中基于零的索引。类型索引的数量由标头中的“timecnt”字段指定。每个类型索引必须在[0,“typecnt”-1]范围内。

local time type records: A series of six-octet records specifying a local time type. The number of records is specified by the "typecnt" field in the header. Each record has the following format (the lengths of multi-octet fields are shown in parentheses):

本地时间类型记录:指定本地时间类型的一系列六个八位组记录。记录数由标题中的“typecnt”字段指定。每条记录具有以下格式(多个八位字节字段的长度显示在括号中):

      +---------------+---+---+
      |  utoff (4)    |dst|idx|
      +---------------+---+---+
        
      +---------------+---+---+
      |  utoff (4)    |dst|idx|
      +---------------+---+---+
        

utoff: A four-octet signed integer specifying the number of seconds to be added to UT in order to determine local time. The value MUST NOT be -2**31 and SHOULD be in the range [-89999, 93599] (i.e., its value SHOULD be more than -25 hours and less than 26 hours). Avoiding -2**31 allows 32-bit clients to negate the value without overflow. Restricting it to [-89999, 93599] allows easy support by implementations that already support the POSIX-required range [-24:59:59, 25:59:59].

utoff:一个四个八位组的有符号整数,指定要添加到UT以确定本地时间的秒数。该值不得为-2**31,且应在[-8999993599]范围内(即,其值应大于-25小时,小于26小时)。避免-2**31允许32位客户端在不溢出的情况下对值求反。将其限制在[-89999,93599]允许已经支持POSIX所需范围[-24:59:59,25:59:59]的实现轻松支持。

(is)dst: A one-octet value indicating whether local time should be considered Daylight Saving Time (DST). The value MUST be 0 or 1. A value of one (1) indicates that this type of time is DST. A value of zero (0) indicates that this time type is standard time.

(is)dst:一个八位字节值,指示是否应将本地时间视为夏令时(dst)。该值必须为0或1。值为一(1)表示此类型的时间为DST。值为零(0)表示此时间类型为标准时间。

(desig)idx: A one-octet unsigned integer specifying a zero-based index into the series of time zone designation octets, thereby selecting a particular designation string. Each index MUST be in the range [0, "charcnt" - 1]; it designates the NUL-terminated string of octets starting at position "idx" in the time zone designations. (This string MAY be empty.) A NUL octet MUST exist in the time zone designations at or after position "idx".

(desig)idx:一个八位字节的无符号整数,指定时区指定八位字节序列中基于零的索引,从而选择特定的指定字符串。每个索引必须在[0,“charcnt”-1]范围内;它指定从时区指定中的位置“idx”开始的以NUL结尾的八位字节字符串。(此字符串可能为空。)在“idx”位置或之后的时区名称中必须存在NUL八位字节。

time zone designations: A series of octets constituting an array of NUL-terminated (0x00) time zone designation strings. The total number of octets is specified by the "charcnt" field in the header. Note that two designations MAY overlap if one is a suffix of the other. The character encoding of time zone designation strings is not specified; however, see Section 4 of this document.

时区指定:一系列八位字节组成以NUL结尾(0x00)的时区指定字符串数组。八位字节的总数由标头中的“charcnt”字段指定。请注意,如果一个名称是另一个的后缀,则两个名称可能重叠。未指定时区指定字符串的字符编码;但是,请参见本文件第4节。

leap-second records: A series of eight- or twelve-octet records specifying the corrections that need to be applied to UTC in order to determine TAI. The records are sorted by the occurrence time in strictly ascending order. The number of records is specified by the "leapcnt" field in the header. Each record has one of the following structures (the lengths of multi-octet fields are shown in parentheses):

闰秒记录:一系列八个或十二个八位字节的记录,指定需要应用于UTC以确定TAI的校正。记录按发生时间严格按升序排序。记录数由标题中的“leapcnt”字段指定。每个记录具有以下结构之一(多个八位字节字段的长度显示在括号中):

Version 1 Data Block:

版本1数据块:

      +---------------+---------------+
      |  occur (4)    |  corr (4)     |
      +---------------+---------------+
        
      +---------------+---------------+
      |  occur (4)    |  corr (4)     |
      +---------------+---------------+
        

version 2+ Data Block:

版本2+数据块:

      +---------------+---------------+---------------+
      |  occur (8)                    |  corr (4)     |
      +---------------+---------------+---------------+
        
      +---------------+---------------+---------------+
      |  occur (8)                    |  corr (4)     |
      +---------------+---------------+---------------+
        

occur(rence): A four- or eight-octet UNIX leap time value specifying the time at which a leap-second correction occurs. The first value, if present, MUST be nonnegative, and each later value MUST be at least 2419199 greater than the previous value. (This is 28 days' worth of seconds, minus a potential negative leap second.)

发生(rence):四个或八个八位字节的UNIX闰时间值,指定发生闰秒校正的时间。第一个值(如果存在)必须是非负的,后面的每个值必须至少比前一个值大2419199。(这是28天的秒,减去一个潜在的负闰秒。)

corr(ection): A four-octet signed integer specifying the value of LEAPCORR on or after the occurrence. The correction value in the first leap-second record, if present, MUST be either one (1) or minus one (-1). The correction values in adjacent leap-second records MUST differ by exactly one (1). The value of LEAPCORR is zero for timestamps that occur before the occurrence time in the first leap-second record (or for all timestamps if there are no leap-second records).

corr(section):一个四个八位组的有符号整数,指定发生时或之后的LEAPCORR值。第一个闰秒记录中的校正值(如果存在)必须为一(1)或负一(-1)。相邻闰秒记录中的校正值必须正好相差一(1)。对于第一个闰秒记录中出现时间之前出现的时间戳,LEAPCORR的值为零(如果没有闰秒记录,则对于所有时间戳)。

standard/wall indicators: A series of one-octet values indicating whether the transition times associated with local time types were specified as standard time or wall-clock time. Each value MUST be 0 or 1. A value of one (1) indicates standard time. The value MUST be set to one (1) if the corresponding UT/local indicator is

标准/墙壁指示器:一系列一个八位字节值,指示与本地时间类型关联的转换时间是指定为标准时间还是挂钟时间。每个值必须为0或1。值为一(1)表示标准时间。如果相应的UT/本地指示器为,则必须将该值设置为一(1)

set to one (1). A value of zero (0) indicates wall time. The number of values is specified by the "isstdcnt" field in the header. If "isstdcnt" is zero (0), all transition times associated with local time types are assumed to be specified as wall time.

设置为一(1)。值为零(0)表示墙时间。值的数量由标头中的“isstdcnt”字段指定。如果“isstdcnt”为零(0),则假定与本地时间类型关联的所有转换时间都指定为墙时间。

UT/local indicators: A series of one-octet values indicating whether the transition times associated with local time types were specified as UT or local time. Each value MUST be 0 or 1. A value of one (1) indicates UT, and the corresponding standard/wall indicator MUST also be set to one (1). A value of zero (0) indicates local time. The number of values is specified by the "isutcnt" field in the header. If "isutcnt" is zero (0), all transition times associated with local time types are assumed to be specified as local time.

UT/本地指示符:一系列的一个八位组值,指示与本地时间类型关联的转换时间是指定为UT还是本地时间。每个值必须为0或1。值为一(1)表示UT,相应的标准/墙壁指示器也必须设置为一(1)。值为零(0)表示本地时间。值的数量由标题中的“isutcnt”字段指定。如果“isutcnt”为零(0),则假定与本地时间类型关联的所有转换时间都指定为本地时间。

The type corresponding to a transition time specifies local time for timestamps starting at the given transition time and continuing up to, but not including, the next transition time. Local time for timestamps before the first transition is specified by the first time type (time type 0). Local time for timestamps on or after the last transition is specified by the TZ string in the footer (Section 3.3) if present and nonempty; otherwise, it is unspecified. If there are no transitions, local time for all timestamps is specified by the TZ string in the footer if present and nonempty; otherwise, it is specified by time type 0.

对应于转换时间的类型指定时间戳的本地时间,该时间戳从给定转换时间开始,一直持续到下一个转换时间,但不包括下一个转换时间。第一次转换前时间戳的本地时间由第一时间类型(时间类型0)指定。最后一次转换上或之后的时间戳的本地时间由页脚(第3.3节)中的TZ字符串指定(如果存在且非空);否则,它是未指定的。如果没有转换,则所有时间戳的本地时间由页脚中的TZ字符串指定(如果存在且非空);否则,它由时间类型0指定。

A given pair of standard/wall and UT/local indicators is used to designate whether the corresponding transition time was specified as UT, standard time, or wall-clock time. Note that there are only three combinations of the two indicators, given that the standard/ wall value MUST be one (1) if the UT/local value is one (1). This information can be useful if the transition times in a TZif file need to be transformed into transitions appropriate for another time zone (e.g. when calculating transition times for a simple POSIX TZ string such as "AKST9AKDT").

给定的一对标准/墙壁和UT/本地指示器用于指定相应的转换时间是指定为UT、标准时间还是挂钟时间。请注意,鉴于如果UT/局部值为一(1),则标准/壁值必须为一(1),两个指示器只有三种组合。如果TZif文件中的转换时间需要转换为适用于另一时区的转换(例如,在计算简单POSIX TZ字符串(如“AKST9AKDT”)的转换时间时),此信息非常有用。

In order to eliminate unused space in a TZif file, every nonzero local time type index SHOULD appear at least once in the transition type array. Likewise, every octet in the time zone designations array SHOULD be used by at least one time type record.

为了消除TZif文件中未使用的空间,每个非零本地时间类型索引应在转换类型数组中至少出现一次。同样,时区名称数组中的每个八位字节都应该由至少一个时间类型记录使用。

3.3. TZif Footer
3.3. TZif页脚

The TZif footer is structured as follows (the lengths of multi-octet fields are shown in parentheses):

TZif页脚的结构如下(多个八位字段的长度显示在括号中):

                      +---+--------------------+---+
                      | NL|  TZ string (0...)  |NL |
                      +---+--------------------+---+
        
                      +---+--------------------+---+
                      | NL|  TZ string (0...)  |NL |
                      +---+--------------------+---+
        

TZif Footer

TZif页脚

The elements of the footer are defined as follows:

页脚的元素定义如下:

NL: An ASCII new line character (0x0A).

NL:ASCII新行字符(0x0A)。

TZ string: A rule for computing local time changes after the last transition time stored in the version 2+ data block. The string is either empty or uses the expanded format of the "TZ" environment variable as defined in Section 8.3 of the "Base Definitions" volume of [POSIX] with ASCII encoding, possibly utilizing extensions described below (Section 3.3.1) in version 3 files. If the string is empty, the corresponding information is not available. If the string is nonempty and one or more transitions appear in the version 2+ data, the string MUST be consistent with the last version 2+ transition. In other words, evaluating the TZ string at the time of the last transition should yield the same time type as was specified in the last transition. The string MUST NOT contain NUL octets or be NUL-terminated, and it SHOULD NOT begin with the ':' (colon) character.

TZ字符串:用于计算存储在版本2+数据块中的最后一次转换时间之后的本地时间更改的规则。字符串为空或使用[POSIX]的“基本定义”卷第8.3节中定义的“TZ”环境变量的扩展格式,使用ASCII编码,可能使用版本3文件中下面描述的扩展名(第3.3.1节)。如果字符串为空,则相应的信息不可用。如果该字符串为非空且版本2+数据中出现一个或多个转换,则该字符串必须与上一个版本2+转换一致。换言之,在最后一次转换时对TZ字符串求值应产生与在最后一次转换中指定的时间类型相同的时间类型。字符串不得包含NUL八位字节或以NUL结尾,且不得以“:”(冒号)字符开头。

The TZif footer is present only in version 2 and 3 files, as the obsolescent version 1 format was designed before the need for a footer was apparent.

TZif页脚仅存在于版本2和版本3文件中,因为过时的版本1格式是在明显需要页脚之前设计的。

3.3.1. TZ String Extensions
3.3.1. TZ字符串扩展

The TZ string in a version 3 TZif file MAY use the following extensions to POSIX TZ strings. These extensions are described using the terminology of Section 8.3 of the "Base Definitions" volume of [POSIX].

版本3 TZif文件中的TZ字符串可以使用以下POSIX TZ字符串扩展名。这些扩展使用[POSIX]的“基本定义”卷第8.3节中的术语进行描述。

o The hours part of the transition times may be signed and range from -167 through 167 (-167 <= hh <= 167) instead of the POSIX-required unsigned values from 0 through 24.

o 转换时间的小时部分可以是有符号的,范围从-167到167(-167<=hh<=167),而不是POSIX要求的0到24的无符号值。

Example: <-03>3<-02>,M3.5.0/-2,M10.5.0/-1 This represents a time zone that observes daylight saving time from 22:00 on the day before March's last Sunday until 23:00 on the day before October's last Sunday. Standard time is 3 hours west of UT and is abbreviated "-03"; daylight saving time is 2 hours west of UT and is abbreviated "-02".

示例:<-03>3<-02>,M3.5.0/-2,M10.5.0//-1这表示从3月最后一个星期日前一天的22:00到10月最后一个星期日前一天的23:00遵守夏令时的时区。标准时间为UT以西3小时,缩写为“-03”;夏令时在UT以西2小时,缩写为“-02”。

o DST is considered to be in effect all year if it starts January 1 at 00:00 and ends December 31 at 24:00 plus the difference between daylight saving and standard time, leaving no room for standard time in the calendar.

o 如果DST从1月1日00:00开始,到12月31日24:00结束,再加上夏令时和标准时间之间的差额,则被视为全年有效,日历中没有标准时间的空间。

Example: EST5EDT,0/0,J365/25 This represents a time zone that observes daylight saving time all year. It is 4 hours west of UT and is abbreviated "EDT".

示例:EST5EDT,0/0,J365/25这表示全年遵守夏令时的时区。它位于UT以西4小时,缩写为“EDT”。

4. Interoperability Considerations
4. 互操作性注意事项

The following practices help ensure the interoperability of TZif applications.

以下实践有助于确保TZif应用程序的互操作性。

o Version 1 files are considered a legacy format and SHOULD NOT be generated, as they do not support transition times after the year 2038.

o 版本1文件被视为旧格式,不应生成,因为它们不支持2038年之后的转换时间。

o Implementations that only understand version 1 MUST ignore any data that extends beyond the calculated end of the version 1 data block.

o 仅理解版本1的实现必须忽略超出版本1数据块计算端的任何数据。

o Implementations SHOULD generate a version 3 file if TZ string extensions are necessary to accurately model transition times. Otherwise, version 2 files SHOULD be generated.

o 如果需要TZ字符串扩展名来准确地建模转换时间,则实现应该生成版本3文件。否则,应生成版本2文件。

o 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

o 由版本1页眉和数据块定义的时间更改顺序应该是由版本2+页眉和数据块以及页脚定义的时间更改的连续子序列。本指南有助于淘汰版本1的读者达成一致

with current readers about timestamps within the contiguous sub-sequence. It also lets writers not supporting obsolescent readers use a "timecnt" of zero in the version 1 data block to save space.

与当前读取器讨论连续子序列中的时间戳。它还允许不支持过时读取器的写入程序在版本1数据块中使用零的“timecnt”以节省空间。

o 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.

o 时区名称应由字母数字集“-”和“+”中至少三(3)个且不超过六(6)个ASCII字符组成。这是为了与POSIX时区缩写的要求兼容。

o When reading a version 2 or 3 file, implementations SHOULD ignore the version 1 header and data block except for the purpose of skipping over them.

o 读取版本2或版本3文件时,实现应忽略版本1标头和数据块,除非跳过它们。

o Implementations 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.

o 作为文件有效性检查的一部分,实现应该计算头和数据块的总长度,并检查它们是否都符合实际文件大小。

o When a TZif file is used in a MIME message entity, it SHOULD be indicated by one of the following media types:

o 在MIME消息实体中使用TZif文件时,应使用以下媒体类型之一表示:

* "application/tzif-leap" (Section 8.2) to indicate that leap-second records are included in the TZif data as necessary (none are necessary if the file is truncated to a range that precedes the first leap second).

* “应用程序/tzif leap”(第8.2节),指示tzif数据中包含必要的闰秒记录(如果文件被截断到第一个闰秒之前的范围,则无需任何记录)。

* "application/tzif" (Section 8.1) to indicate that leap-second records are not included in the TZif data; "leapcnt" in the header(s) MUST be zero (0).

* “应用/tzif”(第8.1节),表明tzif数据中不包括闰秒记录;标题中的“leapcnt”必须为零(0)。

o Common interoperability issues and possible workarounds are described in Appendix A.

o 附录A中描述了常见的互操作性问题和可能的解决方法。

5. Use with the Time Zone Data Distribution Service
5. 与时区数据分发服务一起使用

The Time Zone Data Distribution Service (TZDIST) [RFC7808] is a service that allows reliable, secure, and fast delivery of time zone data and leap-second rules to client systems such as calendaring and scheduling applications or operating systems.

时区数据分发服务(TZDIST)[RFC7808]是一项服务,它允许向客户端系统(如日历和调度应用程序或操作系统)可靠、安全和快速地传递时区数据和闰秒规则。

A TZDIST service MAY supply time zone data to clients in the Time Zone Information Format. Such a service MUST indicate that it supports this format by including the media type "application/tzif" (Section 8.1) in its "capabilities" response (see Section 5.1 of [RFC7808]). A TZDIST service MAY also include the media type "application/tzif-leap" (Section 8.2) in its "capabilities" response if it is able to generate TZif files containing leap-second records. A TZDIST service MUST NOT advertise the "application/tzif-leap" media type without also advertising "application/tzif".

TZDIST服务可以以时区信息格式向客户端提供时区数据。此类服务必须通过在其“能力”响应中包含媒体类型“应用程序/tzif”(第8.1节)(见[RFC7808]第5.1节)来表明其支持此格式。如果TZDIST服务能够生成包含闰秒记录的tzif文件,则其“功能”响应中还可能包含媒体类型“应用程序/tzif leap”(第8.2节)。TZDIST服务不得在不宣传“application/tzif”的情况下宣传“application/tzif leap”媒体类型。

TZDIST clients MUST use the HTTP "Accept" [RFC7231] header field to indicate their preference to receive data in the "application/tzif" and/or "application/tzif-leap" formats.

TZDIST客户机必须使用HTTP“Accept”[RFC7231]标头字段来指示其首选接收“application/tzif”和/或“application/tzif”格式的数据。

5.1. Truncating TZif Files
5.1. 截断TZif文件

As described in Section 3.9 of [RFC7808], a TZDIST service MAY truncate time zone transition data. A truncated TZif file is valid from its first and up to, but not including, its last version 2+ transition time, if present.

如[RFC7808]第3.9节所述,TZDIST服务可截断时区转换数据。被截断的TZif文件从其第一个版本到最后一个版本2+转换时间(如果存在)有效。

When truncating the start of a TZif file, the service MUST supply in the version 2+ data a first transition time that is the start point of the truncation range. As with untruncated TZif files, time type 0 indicates local time immediately before the start point, and the time type of the first transition indicates local time thereafter.

截断TZif文件的开始时,服务必须在版本2+数据中提供第一个转换时间,该时间是截断范围的开始点。与不受信任的TZif文件一样,时间类型0表示起点之前的本地时间,而第一次转换的时间类型表示起点之后的本地时间。

When truncating the end of a TZif file, the service MUST supply in the version 2+ data a last transition time that is the end point of the truncation range and MUST supply an empty TZ string. As with untruncated TZif files with empty TZ strings, a truncated TZif file does not indicate local time after the last transition.

截断TZif文件的结尾时,服务必须在版本2+数据中提供最后一次转换时间,该时间是截断范围的终点,并且必须提供空的TZ字符串。与带有空TZ字符串的不受信任TZif文件一样,被截断的TZif文件不表示上次转换后的本地时间。

All represented information that falls inside the truncation range MUST be the same as that represented by a corresponding untruncated TZif file.

位于截断范围内的所有表示信息必须与相应的不受信任TZif文件表示的信息相同。

TZDIST clients SHOULD NOT use a truncated TZif file (as described above) to interpret timestamps outside the truncation time range.

TZDIST客户端不应使用截断的TZif文件(如上所述)来解释截断时间范围之外的时间戳。

5.2. Example TZDIST Request for TZif Data
5.2. TZif数据的TZDIST请求示例

In this example, the client checks the server for the available formats and then requests that the time zone with a specific time zone identifier be returned in Time Zone Information Format.

在本例中,客户机检查服务器的可用格式,然后请求以时区信息格式返回具有特定时区标识符的时区。

Note that this example presumes that the time zone context path has been discovered (see [RFC7808], Section 4.2.1) to be "/tzdist".

注意,该示例假定已发现时区上下文路径(参见[RFC7808],第4.2.1节)为“/tzdist”。

   >> Request <<
        
   >> Request <<
        
   GET /tzdist/capabilities HTTP/1.1
   Host: tz.example.com
        
   GET /tzdist/capabilities HTTP/1.1
   Host: tz.example.com
        
   >> Response <<
        
   >> Response <<
        
   HTTP/1.1 200 OK
   Date: Fri, 01 Jun 2018 14:52:23 GMT
   Content-Type: application/json; charset="utf-8"
   Content-Length: xxxx
        
   HTTP/1.1 200 OK
   Date: Fri, 01 Jun 2018 14:52:23 GMT
   Content-Type: application/json; charset="utf-8"
   Content-Length: xxxx
        

{ "version": 1,

{“版本”:1,

     "info": {
       "primary-source": "IANA:2018e",
       "formats": [
         "text/calendar",
         "application/tzif",
         "application/tzif-leap"
       ],
   ...
     },
   ...
   }
        
     "info": {
       "primary-source": "IANA:2018e",
       "formats": [
         "text/calendar",
         "application/tzif",
         "application/tzif-leap"
       ],
   ...
     },
   ...
   }
        
   >> Request <<
        
   >> Request <<
        
   GET /tzdist/zones/America%2FNew_York HTTP/1.1
   Host: tz.example.com
   Accept: application/tzif
        
   GET /tzdist/zones/America%2FNew_York HTTP/1.1
   Host: tz.example.com
   Accept: application/tzif
        
   >> Response <<
        
   >> Response <<
        
   HTTP/1.1 200 OK
   Date: Fri, 01 Jun 2018 14:52:24 GMT
   Content-Type: application/tzif
   Content-Length: xxxx
   ETag: "123456789-000-111"
        
   HTTP/1.1 200 OK
   Date: Fri, 01 Jun 2018 14:52:24 GMT
   Content-Type: application/tzif
   Content-Length: xxxx
   ETag: "123456789-000-111"
        

TZif2...[binary data without leap-second records]... EST5EDT,M3.2.0,M11.1.0

TZif2…[无闰秒记录的二进制数据]。。。EST5EDT,M3.2.0,M11.1.0

6. Security Considerations
6. 安全考虑

The Time Zone Information Format contains no executable code, and it does not define any extensible areas that could be used to store such code.

时区信息格式不包含可执行代码,也不定义可用于存储此类代码的任何可扩展区域。

TZif contains counted arrays of data elements. All counts should be checked when processing TZif objects, to guard against references past the end of the object.

TZif包含已计数的数据元素数组。处理TZif对象时,应检查所有计数,以防止引用超过对象的末尾。

TZif provides no confidentiality or integrity protection. Time zone information is normally public and does not call for confidentiality protection. Since time zone information is used in many critical applications, integrity protection may be required and must be provided externally.

TZif不提供机密性或完整性保护。时区信息通常是公开的,不需要保密保护。由于时区信息用于许多关键应用程序,因此可能需要完整性保护,并且必须在外部提供完整性保护。

7. Privacy Considerations
7. 隐私考虑

The Time Zone Information Format contains publicly available data, and it does not define any extensible areas that could be used to store private data.

时区信息格式包含公开可用的数据,并且没有定义任何可用于存储私有数据的可扩展区域。

As discussed in Section 9 of [RFC7808], transmission of time zone data over an insecure communications channel could leak the past, current, or future location of a device or user. As such, TZif data transmitted over a public communications channel MUST be protected with a confidentiality layer such as that provided by Transport Layer Security (TLS) [RFC8446].

如[RFC7808]第9节所述,通过不安全的通信信道传输时区数据可能泄漏设备或用户的过去、当前或未来位置。因此,通过公共通信信道传输的TZif数据必须使用保密层进行保护,如传输层安全(TLS)[RFC8446]提供的保密层。

8. IANA Considerations
8. IANA考虑

This document defines two media types [RFC6838] for the exchange of data utilizing the Time Zone Information Format.

本文件定义了两种媒体类型[RFC6838],用于利用时区信息格式交换数据。

8.1. application/tzif
8.1. 应用程序/tzif

Type name: application

类型名称:应用程序

Subtype name: tzif

子类型名称:tzif

Required parameters: none

所需参数:无

Optional parameters: none

可选参数:无

Encoding considerations: binary

编码注意事项:二进制

Security considerations: See Section 6 of RFC 8536.

安全注意事项:见RFC 8536第6节。

Interoperability considerations: See Section 4 of RFC 8536.

互操作性注意事项:参见RFC 8536第4节。

Published specification: This specification.

已发布规范:本规范。

Applications that use this media type: This media type is designed for widespread use by applications that need to use or exchange time zone information, such as the Time Zone Information Compiler (zic) [ZIC] and the GNU C Library [GNU-C]. The Time Zone Distribution Service [RFC7808] can directly use this media type.

使用此媒体类型的应用程序:此媒体类型设计用于需要使用或交换时区信息的应用程序的广泛使用,例如时区信息编译器(zic)[zic]和GNU C库[GNU-C]。时区分发服务[RFC7808]可以直接使用此媒体类型。

Fragment identifier considerations: N/A

片段标识符注意事项:不适用

Additional information:

其他信息:

Magic number(s): The first 4 octets are 0x54, 0x5A, 0x69, 0x66

幻数:前4个八位字节是0x54、0x5A、0x69、0x66

      File extensions(s):  N/A
        
      File extensions(s):  N/A
        
      Macintosh file type code(s):  N/A
        
      Macintosh file type code(s):  N/A
        
   Person & email address to contact for further information:
      Time Zone Database mailing list <tz@iana.org>
        
   Person & email address to contact for further information:
      Time Zone Database mailing list <tz@iana.org>
        

Intended usage: COMMON

预期用途:普通

Restrictions on usage: N/A

使用限制:不适用

Author: See the "Authors' Addresses" section of RFC 8536.

作者:参见RFC 8536的“作者地址”部分。

Change controller: IETF

更改控制器:IETF

8.2. application/tzif-leap
8.2. 应用程序/tzif leap

Type name: application

类型名称:应用程序

Subtype name: tzif-leap

子类型名称:tzif leap

Required parameters: none

所需参数:无

Optional parameters: none

可选参数:无

Encoding considerations: binary

编码注意事项:二进制

Security considerations: See Section 6 of RFC 8536.

安全注意事项:见RFC 8536第6节。

Interoperability considerations: See Section 4 of RFC 8536.

互操作性注意事项:参见RFC 8536第4节。

Published specification: This specification.

已发布规范:本规范。

Applications that use this media type: This media type is designed for widespread use by applications that need to use or exchange time zone information, such as the Time Zone Information Compiler (zic) [ZIC] and the GNU C Library [GNU-C]. The Time Zone Distribution Service [RFC7808] can directly use this media type.

使用此媒体类型的应用程序:此媒体类型设计用于需要使用或交换时区信息的应用程序的广泛使用,例如时区信息编译器(zic)[zic]和GNU C库[GNU-C]。时区分发服务[RFC7808]可以直接使用此媒体类型。

Fragment identifier considerations: N/A

片段标识符注意事项:不适用

Additional information:

其他信息:

Magic number(s): The first 4 octets are 0x54, 0x5A, 0x69, 0x66

幻数:前4个八位字节是0x54、0x5A、0x69、0x66

      File extensions(s):  N/A
        
      File extensions(s):  N/A
        
      Macintosh file type code(s):  N/A
        
      Macintosh file type code(s):  N/A
        
   Person & email address to contact for further information:
      Time Zone Database mailing list <tz@iana.org>
        
   Person & email address to contact for further information:
      Time Zone Database mailing list <tz@iana.org>
        

Intended usage: COMMON

预期用途:普通

Restrictions on usage: N/A

使用限制:不适用

Author: See the "Authors' Addresses" section of RFC 8536.

作者:参见RFC 8536的“作者地址”部分。

Change controller: IETF

更改控制器:IETF

9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[GNU-C] "The GNU C Library (glibc)", <https://www.gnu.org/software/libc/>.

[GNU-C]“GNU-C库(glibc)”<https://www.gnu.org/software/libc/>.

[POSIX] IEEE, "Standard for Information Technology--Portable Operating System Interface (POSIX(R)) Base Specifications, Issue 7", IEEE 1003.1-2017, DOI 10.1109/IEEESTD.2018.8277153, January 2018, <http://pubs.opengroup.org/onlinepubs/9699919799/>.

[POSIX]IEEE,“信息技术标准——便携式操作系统接口(POSIX(R))基本规范,第7期”,IEEE 1003.1-2017,DOI 10.1109/IEEESTD.2018.8277153,2018年1月<http://pubs.opengroup.org/onlinepubs/9699919799/>.

[RFC20] Cerf, V., "ASCII format for network interchange", STD 80, RFC 20, DOI 10.17487/RFC0020, October 1969, <https://www.rfc-editor.org/info/rfc20>.

[RFC20]Cerf,V.,“网络交换的ASCII格式”,STD 80,RFC 20,DOI 10.17487/RFC0020,1969年10月<https://www.rfc-editor.org/info/rfc20>.

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<https://www.rfc-editor.org/info/rfc2119>.

[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, DOI 10.17487/RFC6838, January 2013, <https://www.rfc-editor.org/info/rfc6838>.

[RFC6838]Freed,N.,Klensin,J.和T.Hansen,“介质类型规范和注册程序”,BCP 13,RFC 6838,DOI 10.17487/RFC6838,2013年1月<https://www.rfc-editor.org/info/rfc6838>.

[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-editor.org/info/rfc7231>.

[RFC7231]Fielding,R.,Ed.和J.Reschke,Ed.,“超文本传输协议(HTTP/1.1):语义和内容”,RFC 7231,DOI 10.17487/RFC72312014年6月<https://www.rfc-editor.org/info/rfc7231>.

[RFC7808] Douglass, M. and C. Daboo, "Time Zone Data Distribution Service", RFC 7808, DOI 10.17487/RFC7808, March 2016, <https://www.rfc-editor.org/info/rfc7808>.

[RFC7808]Douglass,M.和C.Daboo,“时区数据分发服务”,RFC 7808,DOI 10.17487/RFC78082016年3月<https://www.rfc-editor.org/info/rfc7808>.

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC8174]Leiba,B.,“RFC 2119关键词中大写与小写的歧义”,BCP 14,RFC 8174,DOI 10.17487/RFC8174,2017年5月<https://www.rfc-editor.org/info/rfc8174>.

[ZIC] Kerrisk, M., "ZIC(8)", man-pages release 4.16, February 2010, <http://man7.org/linux/man-pages/man8/zic.8.html>.

[ZIC]Kerrisk,M.,“ZIC(8)”,手册页发行版4.162010年2月<http://man7.org/linux/man-pages/man8/zic.8.html>.

9.2. Informative References
9.2. 资料性引用

[EGGERT-TZ] "History for tz", October 2018, <https://github.com/eggert/tz/commits/master/tzfile.5>.

[EGGERT-TZ]“TZ的历史”,2018年10月<https://github.com/eggert/tz/commits/master/tzfile.5>.

[RFC5545] Desruisseaux, B., Ed., "Internet Calendaring and Scheduling Core Object Specification (iCalendar)", RFC 5545, DOI 10.17487/RFC5545, September 2009, <https://www.rfc-editor.org/info/rfc5545>.

[RFC5545]Desruisseaux,B.,Ed.“互联网日历和调度核心对象规范(iCalendar)”,RFC 5545,DOI 10.17487/RFC5545,2009年9月<https://www.rfc-editor.org/info/rfc5545>.

[RFC6557] Lear, E. and P. Eggert, "Procedures for Maintaining the Time Zone Database", BCP 175, RFC 6557, DOI 10.17487/RFC6557, February 2012, <https://www.rfc-editor.org/info/rfc6557>.

[RFC6557]Lear,E.和P.Eggert,“时区数据库维护程序”,BCP 175,RFC 6557,DOI 10.17487/RFC6557,2012年2月<https://www.rfc-editor.org/info/rfc6557>.

[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, <https://www.rfc-editor.org/info/rfc8446>.

[RFC8446]Rescorla,E.“传输层安全(TLS)协议版本1.3”,RFC 8446,DOI 10.17487/RFC8446,2018年8月<https://www.rfc-editor.org/info/rfc8446>.

[tz-link] Eggert, P. and A. Olson, "Sources for Time Zone and Daylight Saving Time Data", 2018, <https://www.iana.org/time-zones/repository/ tz-link.html>.

[tz link]Eggert,P.和A.Olson,“时区和夏令时数据来源”,2018年<https://www.iana.org/time-zones/repository/ tz link.html>。

Appendix A. Common Interoperability Issues
附录A.通用互操作性问题

This section documents common problems in implementing this specification. Most of these are problems in generating TZif files for use by readers conforming to predecessors of this specification [EGGERT-TZ]. The goals of this section are:

本节记录了实施本规范中的常见问题。其中大多数是在生成TZif文件以供符合本规范前辈[EGGERT-TZ]的读者使用时出现的问题。本节的目标是:

1. to help TZif writers output files that avoid common pitfalls in older or buggy TZif readers,

1. 为了帮助TZif编写器输出文件,避免旧的或有缺陷的TZif读取器中的常见陷阱,

2. to help TZif readers avoid common pitfalls when reading files generated by future TZif writers, and

2. 帮助TZif读取器在读取未来TZif编写器生成的文件时避免常见陷阱,以及

3. to help any future specification authors see what sort of problems arise when the TZif format is changed.

3. 为了帮助任何未来的规范作者了解TZif格式更改时会出现什么样的问题。

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 new-version data useful even for older-version readers. This section attempts to document these compatibility issues and workarounds, as well as documenting other common bugs in readers.

定义了TZif格式的新版本后,设计目标是使读取器能够成功使用TZif文件,即使该文件的TZif版本高于读取器的设计版本。当无法实现完全兼容性时,会尝试将故障限制在很少使用的时间戳上,并允许编写器进行简单的局部解决,以生成新版本数据,即使对旧版本的读者也有用。本节试图记录这些兼容性问题和解决方法,并记录阅读器中的其他常见错误。

Interoperability problems with TZif include the following:

TZif的互操作性问题包括:

o Some readers examine only version 1 data. As a partial workaround, a writer can output as much version 1 data as possible. However, a reader should ignore version 1 data and use version 2+ data, even if the reader's native timestamps have only 32 bits.

o 有些读者只检查版本1数据。作为部分解决方法,编写器可以输出尽可能多的版本1数据。但是,读卡器应该忽略版本1数据而使用版本2+数据,即使读卡器的本机时间戳只有32位。

o Some readers designed for version 2 might mishandle timestamps after a version 3 file's last transition, because they cannot parse extensions to POSIX in the TZ-like string. As a partial workaround, a writer can output more transitions than necessary, so that only far-future timestamps are mishandled by version 2 readers.

o 一些为版本2设计的阅读器可能会在版本3文件的最后一次转换后错误地处理时间戳,因为它们无法在类似于TZ的字符串中解析POSIX的扩展。作为一种局部解决方法,编写器可以输出比所需更多的转换,因此版本2读取器只能错误地处理遥远的将来的时间戳。

o Some readers designed for version 2 do not support permanent daylight saving time -- e.g., a TZ string "EST5EDT,0/0,J365/25" denoting permanent Eastern Daylight Time (-04). As a partial workaround, a writer can substitute standard time for the next time zone east -- e.g., "AST4" for permanent Atlantic Standard Time (-04).

o 一些为版本2设计的读卡器不支持永久夏令时,例如,表示永久东部夏令时(-04)的TZ字符串“EST5EDT,0/0,J365/25”。作为一种局部解决方法,编写器可以用标准时间替换下一个时区东部——例如,“AST4”替换永久性大西洋标准时间(-04)。

o Some readers ignore the footer and instead predict future timestamps from the time type of the last transition. As a partial workaround, a writer can output more transitions than necessary.

o 有些读者忽略了页脚,而是根据最后一次转换的时间类型预测未来的时间戳。作为一种局部解决方法,编写器可以输出比需要更多的转换。

o Some readers do not use time type 0 for timestamps before the first transition, in that they infer a time type using a heuristic that does not always select time type 0. As a partial workaround, a writer can output a dummy (no-op) first transition at an early time.

o 有些读者在第一次转换之前不使用时间类型0作为时间戳,因为他们使用不总是选择时间类型0的启发式方法来推断时间类型。作为一种局部解决方法,编写器可以在早期输出一个伪(无操作)第一次转换。

o Some readers mishandle timestamps before the first transition that has a timestamp not less than -2**31. Readers that support only 32-bit timestamps are likely to be more prone to this problem, for example, when they process 64-bit transitions, only some of which are representable in 32 bits. As a partial workaround, a writer can output a dummy transition at timestamp -2**31.

o 有些读者在时间戳不小于-2**31的第一次转换之前错误地处理了时间戳。仅支持32位时间戳的读卡器可能更容易出现此问题,例如,当它们处理64位转换时,其中只有一些转换可以用32位表示。作为部分解决方法,编写器可以在时间戳-2**31处输出虚拟转换。

o Some readers mishandle a transition if its timestamp has the minimum possible signed 64-bit value. Timestamps less than -2**59 are not recommended.

o 如果转换的时间戳具有最小可能的有符号64位值,则某些读取器会错误处理转换。不建议使用小于-2**59的时间戳。

o Some readers mishandle POSIX-style TZ strings that contain "<" or ">". As a partial workaround, a writer can avoid using '<' or '>' for time zone abbreviations containing only alphabetic characters.

o 一些读者错误地处理了包含“<”或“>”的POSIX样式的TZ字符串。作为部分解决方法,编写者可以避免对仅包含字母字符的时区缩写使用“<”或“>”。

o Many readers mishandle time zone abbreviations that contain non-ASCII characters. These characters are not recommended.

o 许多读者错误地处理了包含非ASCII字符的时区缩写。不建议使用这些字符。

o 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.

o 有些读者可能会错误处理包含少于3个或多于6个字符的时区缩写,或者包含除字母数字“-”和“+”以外的ASCII字符。不建议使用这些缩写。

o Some readers mishandle TZif files that specify daylight saving time UT offsets that are less than the UT offsets for the corresponding standard time. These readers do not support locations like Ireland, which uses the equivalent of the POSIX TZ string "IST-1GMT0,M10.5.0,M3.5.0/1", observing standard time (IST, +01) in summer and daylight saving time (GMT, +00) in winter. As a partial workaround, a writer can output data for the equivalent of the POSIX TZ string "GMT0IST,M3.5.0/1,M10.5.0", thus swapping standard and daylight saving time. Although this workaround misidentifies which part of the year uses daylight saving time, it records UT offsets and time zone abbreviations correctly.

o 某些读取器错误处理了指定夏令时UT偏移小于相应标准时间UT偏移的TZif文件。这些读卡器不支持像爱尔兰这样的位置,爱尔兰使用POSIX TZ字符串“IST-1GMT0,M10.5.0,M3.5.0/1”的等价物,在夏季使用标准时间(IST,+01),在冬季使用夏令时(GMT,+00)。作为一种局部解决方法,编写器可以输出POSIX TZ字符串“GMT0IST,M3.5.0/1,M10.5.0”的等效数据,从而交换标准时间和夏令时。尽管此解决方案错误识别了一年中使用夏令时的部分,但它正确记录了UT偏移量和时区缩写。

Some interoperability problems are reader bugs that are listed here mostly as warnings to developers of readers.

一些互操作性问题是读卡器bug,在这里主要作为对读卡器开发人员的警告列出。

o Some readers do not support negative timestamps. Developers of distributed applications should keep this in mind if they need to deal with pre-1970 data.

o 有些读卡器不支持负时间戳。如果分布式应用程序的开发人员需要处理1970年以前的数据,他们应该记住这一点。

o Some readers mishandle timestamps before the first transition that has a nonnegative timestamp. Readers that do not support negative timestamps are likely to be more prone to this problem.

o 有些读者在具有非负时间戳的第一次转换之前错误地处理了时间戳。不支持负时间戳的读者可能更容易出现此问题。

o Some readers mishandle time zone abbreviations like "-08" that contain '+', '-', or digits.

o 一些读者错误地处理了包含“+”、“-”或数字的时区缩写,如“-08”。

o Some readers mishandle UT offsets that are out of the traditional range of -12 through +12 hours and so do not support locations like Kiritimati that are outside this range.

o 一些读者错误地处理了超出传统范围-12到+12小时的UT偏移量,因此不支持超出此范围的Kiritimati等位置。

o Some readers mishandle UT offsets in the range [-3599, -1] seconds from UT, because they integer-divide the offset by 3600 to get 0 and then display the hour part as "+00".

o 一些读卡器错误地处理了UT偏移量,其范围为距离UT[-3599,-1]秒,因为它们将偏移量除以3600得到0,然后将小时部分显示为“+00”。

o Some readers mishandle UT offsets that are not a multiple of one hour, 15 minutes, or 1 minute.

o 有些读者错误地处理了UT偏移量,这些偏移量不是1小时、15分钟或1分钟的倍数。

Appendix B. Example TZif Files
附录B.TZif文件示例

The following sections contain annotated hexadecimal dumps of example TZif files.

以下部分包含示例TZif文件的带注释的十六进制转储。

Note that these examples should only be considered informative. Although the example data entries are current as of the publication date of this document, the data will likely change in the future as leap seconds are added and changes are made to civil time.

请注意,这些示例仅应被视为信息性示例。尽管示例数据条目在本文档发布日期是最新的,但随着闰秒的增加和民用时间的更改,这些数据将来可能会发生变化。

B.1. Version 1 File Representing UTC (with Leap Seconds)
B.1. 代表UTC的版本1文件(带闰秒)
   +-------+---------------+------------------+------------------------+
   | File  | Data Octets   | Record Name /    | Field Value            |
   | Offset| (hexadecimal) | Field Name       |                        |
   +-------+---------------+------------------+------------------------+
   | 000   | 54 5a 69 66   | magic            | "TZif"                 |
   | 004   | 00            | version          | 0 (1)                  |
   | 005   | 00 00 00 00   |                  |                        |
   |       | 00 00 00 00   |                  |                        |
   |       | 00 00 00 00   |                  |                        |
   |       | 00 00 00      |                  |                        |
   | 020   | 00 00 00 01   | isutccnt         | 1                      |
   | 024   | 00 00 00 01   | isstdcnt         | 1                      |
   | 028   | 00 00 00 1b   | isleapcnt        | 27                     |
   | 032   | 00 00 00 00   | timecnt          | 0                      |
   | 036   | 00 00 00 01   | typecnt          | 1                      |
   | 040   | 00 00 00 04   | charcnt          | 4                      |
   |       |               |                  |                        |
   |       |               | localtimetype[0] |                        |
   | 044   | 00 00 00 00   | utcoff           | 00:00                  |
   | 048   | 00            | isdst            | 0 (no)                 |
   | 049   | 00            | desigidx         | 0                      |
   |       |               |                  |                        |
   | 050   | 55 54 43 00   | designations[0]  | "UTC"                  |
   |       |               |                  |                        |
   |       |               | leapsecond[0]    |                        |
   | 054   | 04 b2 58 00   | occurrence       | 78796800               |
   |       |               |                  | (1972-06-30T23:59:60Z) |
   | 058   | 00 00 00 01   | correction       | 1                      |
   |       |               |                  |                        |
   |       |               | leapsecond[1]    |                        |
   | 062   | 05 a4 ec 01   | occurrence       | 94694401               |
   |       |               |                  | (1972-12-31T23:59:60Z) |
   | 066   | 00 00 00 02   | correction       | 2                      |
   |       |               |                  |                        |
   |       |               | leapsecond[2]    |                        |
   | 070   | 07 86 1f 82   | occurrence       | 126230402              |
   |       |               |                  | (1973-12-31T23:59:60Z) |
   | 074   | 00 00 00 03   | correction       | 3                      |
   |       |               |                  |                        |
   |       |               | leapsecond[3]    |                        |
   | 078   | 09 67 53 03   | occurrence       | 157766403              |
   |       |               |                  | (1974-12-31T23:59:60Z) |
   | 082   | 00 00 00 04   | correction       | 4                      |
   |       |               |                  |                        |
        
   +-------+---------------+------------------+------------------------+
   | File  | Data Octets   | Record Name /    | Field Value            |
   | Offset| (hexadecimal) | Field Name       |                        |
   +-------+---------------+------------------+------------------------+
   | 000   | 54 5a 69 66   | magic            | "TZif"                 |
   | 004   | 00            | version          | 0 (1)                  |
   | 005   | 00 00 00 00   |                  |                        |
   |       | 00 00 00 00   |                  |                        |
   |       | 00 00 00 00   |                  |                        |
   |       | 00 00 00      |                  |                        |
   | 020   | 00 00 00 01   | isutccnt         | 1                      |
   | 024   | 00 00 00 01   | isstdcnt         | 1                      |
   | 028   | 00 00 00 1b   | isleapcnt        | 27                     |
   | 032   | 00 00 00 00   | timecnt          | 0                      |
   | 036   | 00 00 00 01   | typecnt          | 1                      |
   | 040   | 00 00 00 04   | charcnt          | 4                      |
   |       |               |                  |                        |
   |       |               | localtimetype[0] |                        |
   | 044   | 00 00 00 00   | utcoff           | 00:00                  |
   | 048   | 00            | isdst            | 0 (no)                 |
   | 049   | 00            | desigidx         | 0                      |
   |       |               |                  |                        |
   | 050   | 55 54 43 00   | designations[0]  | "UTC"                  |
   |       |               |                  |                        |
   |       |               | leapsecond[0]    |                        |
   | 054   | 04 b2 58 00   | occurrence       | 78796800               |
   |       |               |                  | (1972-06-30T23:59:60Z) |
   | 058   | 00 00 00 01   | correction       | 1                      |
   |       |               |                  |                        |
   |       |               | leapsecond[1]    |                        |
   | 062   | 05 a4 ec 01   | occurrence       | 94694401               |
   |       |               |                  | (1972-12-31T23:59:60Z) |
   | 066   | 00 00 00 02   | correction       | 2                      |
   |       |               |                  |                        |
   |       |               | leapsecond[2]    |                        |
   | 070   | 07 86 1f 82   | occurrence       | 126230402              |
   |       |               |                  | (1973-12-31T23:59:60Z) |
   | 074   | 00 00 00 03   | correction       | 3                      |
   |       |               |                  |                        |
   |       |               | leapsecond[3]    |                        |
   | 078   | 09 67 53 03   | occurrence       | 157766403              |
   |       |               |                  | (1974-12-31T23:59:60Z) |
   | 082   | 00 00 00 04   | correction       | 4                      |
   |       |               |                  |                        |
        
   |       |               | leapsecond[4]    |                        |
   | 086   | 0b 48 86 84   | occurrence       | 189302404              |
   |       |               |                  | (1975-12-31T23:59:60Z) |
   | 090   | 00 00 00 05   | correction       | 5                      |
   |       |               |                  |                        |
   |       |               | leapsecond[5]    |                        |
   | 094   | 0d 2b 0b 85   | occurrence       | 220924805              |
   |       |               |                  | (1976-12-31T23:59:60Z) |
   | 098   | 00 00 00 06   | correction       | 6                      |
   |       |               |                  |                        |
   |       |               | leapsecond[6]    |                        |
   | 102   | 0f 0c 3f 06   | occurrence       | 252460806              |
   |       |               |                  | (1977-12-31T23:59:60Z) |
   | 106   | 00 00 00 07   | correction       | 7                      |
   |       |               |                  |                        |
   |       |               | leapsecond[7]    |                        |
   | 110   | 10 ed 72 87   | occurrence       | 283996807              |
   |       |               |                  | (1978-12-31T23:59:60Z) |
   | 114   | 00 00 00 08   | correction       | 8                      |
   |       |               |                  |                        |
   |       |               | leapsecond[8]    |                        |
   | 118   | 12 ce a6 08   | occurrence       | 315532808              |
   |       |               |                  | (1979-12-31T23:59:60Z) |
   | 122   | 00 00 00 09   | correction       | 9                      |
   |       |               |                  |                        |
   |       |               | leapsecond[9]    |                        |
   | 126   | 15 9f ca 89   | occurrence       | 362793609              |
   |       |               |                  | (1981-06-30T23:59:60Z) |
   | 130   | 00 00 00 0a   | correction       | 10                     |
   |       |               |                  |                        |
   |       |               | leapsecond[10]   |                        |
   | 134   | 17 80 fe 0a   | occurrence       | 394329610              |
   |       |               |                  | (1982-06-30T23:59:60Z) |
   | 138   | 00 00 00 0b   | correction       | 11                     |
   |       |               |                  |                        |
   |       |               | leapsecond[11]   |                        |
   | 142   | 19 62 31 8b   | occurrence       | 425865611              |
   |       |               |                  | (1983-06-30T23:59:60Z) |
   | 146   | 00 00 00 0c   | correction       | 12                     |
   |       |               |                  |                        |
   |       |               | leapsecond[12]   |                        |
   | 150   | 1d 25 ea 0c   | occurrence       | 489024012              |
   |       |               |                  | (1985-06-30T23:59:60Z) |
   | 154   | 00 00 00 0d   | correction       | 13                     |
   |       |               |                  |                        |
   |       |               | leapsecond[13]   |                        |
   | 158   | 21 da e5 0d   | occurrence       | 567993613              |
   |       |               |                  | (1987-12-31T23:59:60Z) |
        
   |       |               | leapsecond[4]    |                        |
   | 086   | 0b 48 86 84   | occurrence       | 189302404              |
   |       |               |                  | (1975-12-31T23:59:60Z) |
   | 090   | 00 00 00 05   | correction       | 5                      |
   |       |               |                  |                        |
   |       |               | leapsecond[5]    |                        |
   | 094   | 0d 2b 0b 85   | occurrence       | 220924805              |
   |       |               |                  | (1976-12-31T23:59:60Z) |
   | 098   | 00 00 00 06   | correction       | 6                      |
   |       |               |                  |                        |
   |       |               | leapsecond[6]    |                        |
   | 102   | 0f 0c 3f 06   | occurrence       | 252460806              |
   |       |               |                  | (1977-12-31T23:59:60Z) |
   | 106   | 00 00 00 07   | correction       | 7                      |
   |       |               |                  |                        |
   |       |               | leapsecond[7]    |                        |
   | 110   | 10 ed 72 87   | occurrence       | 283996807              |
   |       |               |                  | (1978-12-31T23:59:60Z) |
   | 114   | 00 00 00 08   | correction       | 8                      |
   |       |               |                  |                        |
   |       |               | leapsecond[8]    |                        |
   | 118   | 12 ce a6 08   | occurrence       | 315532808              |
   |       |               |                  | (1979-12-31T23:59:60Z) |
   | 122   | 00 00 00 09   | correction       | 9                      |
   |       |               |                  |                        |
   |       |               | leapsecond[9]    |                        |
   | 126   | 15 9f ca 89   | occurrence       | 362793609              |
   |       |               |                  | (1981-06-30T23:59:60Z) |
   | 130   | 00 00 00 0a   | correction       | 10                     |
   |       |               |                  |                        |
   |       |               | leapsecond[10]   |                        |
   | 134   | 17 80 fe 0a   | occurrence       | 394329610              |
   |       |               |                  | (1982-06-30T23:59:60Z) |
   | 138   | 00 00 00 0b   | correction       | 11                     |
   |       |               |                  |                        |
   |       |               | leapsecond[11]   |                        |
   | 142   | 19 62 31 8b   | occurrence       | 425865611              |
   |       |               |                  | (1983-06-30T23:59:60Z) |
   | 146   | 00 00 00 0c   | correction       | 12                     |
   |       |               |                  |                        |
   |       |               | leapsecond[12]   |                        |
   | 150   | 1d 25 ea 0c   | occurrence       | 489024012              |
   |       |               |                  | (1985-06-30T23:59:60Z) |
   | 154   | 00 00 00 0d   | correction       | 13                     |
   |       |               |                  |                        |
   |       |               | leapsecond[13]   |                        |
   | 158   | 21 da e5 0d   | occurrence       | 567993613              |
   |       |               |                  | (1987-12-31T23:59:60Z) |
        
   | 162   | 00 00 00 0e   | correction       | 14                     |
   |       |               |                  |                        |
   |       |               | leapsecond[14]   |                        |
   | 166   | 25 9e 9d 8e   | occurrence       | 631152014              |
   |       |               |                  | (1989-12-31T23:59:60Z) |
   | 170   | 00 00 00 0f   | correction       | 15                     |
   |       |               |                  |                        |
   |       |               | leapsecond[15]   |                        |
   | 174   | 27 7f d1 0f   | occurrence       | 662688015              |
   |       |               |                  | (1990-12-31T23:59:60Z) |
   | 178   | 00 00 00 10   | correction       | 16                     |
   |       |               |                  |                        |
   |       |               | leapsecond[16]   |                        |
   | 182   | 2a 50 f5 90   | occurrence       | 709948816              |
   |       |               |                  | (1992-06-30T23:59:60Z) |
   | 186   | 00 00 00 11   | correction       | 17                     |
   |       |               |                  |                        |
   |       |               | leapsecond[17]   |                        |
   | 190   | 2c 32 29 11   | occurrence       | 741484817              |
   |       |               |                  | (1993-06-30T23:59:60Z) |
   | 194   | 00 00 00 12   | correction       | 18                     |
   |       |               |                  |                        |
   |       |               | leapsecond[18]   |                        |
   | 198   | 2e 13 5c 92   | occurrence       | 773020818              |
   |       |               |                  | (1994-06-30T23:59:60Z) |
   | 202   | 00 00 00 13   | correction       | 19                     |
   |       |               |                  |                        |
   |       |               | leapsecond[19]   |                        |
   | 206   | 30 e7 24 13   | occurrence       | 820454419              |
   |       |               |                  | (1995-12-31T23:59:60Z) |
   | 210   | 00 00 00 14   | correction       | 20                     |
   |       |               |                  |                        |
   |       |               | leapsecond[20]   |                        |
   | 214   | 33 b8 48 94   | occurrence       | 867715220              |
   |       |               |                  | (1997-06-30T23:59:60Z) |
   | 218   | 00 00 00 15   | correction       | 21                     |
   |       |               |                  |                        |
   |       |               | leapsecond[21]   |                        |
   | 222   | 36 8c 10 15   | occurrence       | 915148821              |
   |       |               |                  | (1998-12-31T23:59:60Z) |
   | 226   | 00 00 00 16   | correction       | 22                     |
   |       |               |                  |                        |
   |       |               | leapsecond[22]   |                        |
   | 230   | 43 b7 1b 96   | occurrence       | 1136073622             |
   |       |               |                  | (2005-12-31T23:59:60Z) |
   | 234   | 00 00 00 17   | correction       | 23                     |
   |       |               |                  |                        |
        
   | 162   | 00 00 00 0e   | correction       | 14                     |
   |       |               |                  |                        |
   |       |               | leapsecond[14]   |                        |
   | 166   | 25 9e 9d 8e   | occurrence       | 631152014              |
   |       |               |                  | (1989-12-31T23:59:60Z) |
   | 170   | 00 00 00 0f   | correction       | 15                     |
   |       |               |                  |                        |
   |       |               | leapsecond[15]   |                        |
   | 174   | 27 7f d1 0f   | occurrence       | 662688015              |
   |       |               |                  | (1990-12-31T23:59:60Z) |
   | 178   | 00 00 00 10   | correction       | 16                     |
   |       |               |                  |                        |
   |       |               | leapsecond[16]   |                        |
   | 182   | 2a 50 f5 90   | occurrence       | 709948816              |
   |       |               |                  | (1992-06-30T23:59:60Z) |
   | 186   | 00 00 00 11   | correction       | 17                     |
   |       |               |                  |                        |
   |       |               | leapsecond[17]   |                        |
   | 190   | 2c 32 29 11   | occurrence       | 741484817              |
   |       |               |                  | (1993-06-30T23:59:60Z) |
   | 194   | 00 00 00 12   | correction       | 18                     |
   |       |               |                  |                        |
   |       |               | leapsecond[18]   |                        |
   | 198   | 2e 13 5c 92   | occurrence       | 773020818              |
   |       |               |                  | (1994-06-30T23:59:60Z) |
   | 202   | 00 00 00 13   | correction       | 19                     |
   |       |               |                  |                        |
   |       |               | leapsecond[19]   |                        |
   | 206   | 30 e7 24 13   | occurrence       | 820454419              |
   |       |               |                  | (1995-12-31T23:59:60Z) |
   | 210   | 00 00 00 14   | correction       | 20                     |
   |       |               |                  |                        |
   |       |               | leapsecond[20]   |                        |
   | 214   | 33 b8 48 94   | occurrence       | 867715220              |
   |       |               |                  | (1997-06-30T23:59:60Z) |
   | 218   | 00 00 00 15   | correction       | 21                     |
   |       |               |                  |                        |
   |       |               | leapsecond[21]   |                        |
   | 222   | 36 8c 10 15   | occurrence       | 915148821              |
   |       |               |                  | (1998-12-31T23:59:60Z) |
   | 226   | 00 00 00 16   | correction       | 22                     |
   |       |               |                  |                        |
   |       |               | leapsecond[22]   |                        |
   | 230   | 43 b7 1b 96   | occurrence       | 1136073622             |
   |       |               |                  | (2005-12-31T23:59:60Z) |
   | 234   | 00 00 00 17   | correction       | 23                     |
   |       |               |                  |                        |
        
   |       |               | leapsecond[23]   |                        |
   | 238   | 49 5c 07 97   | occurrence       | 1230768023             |
   |       |               |                  | (2008-12-31T23:59:60Z) |
   | 242   | 00 00 00 18   | correction       | 24                     |
   |       |               |                  |                        |
   |       |               | leapsecond[24]   |                        |
   | 246   | 4f ef 93 18   | occurrence       | 1341100824             |
   |       |               |                  | (2012-06-30T23:59:60Z) |
   | 250   | 00 00 00 19   | correction       | 25                     |
   |       |               |                  |                        |
   |       |               | leapsecond[25]   |                        |
   | 254   | 55 93 2d 99   | occurrence       | 1435708825             |
   |       |               |                  | (2015-06-30T23:59:60Z) |
   | 258   | 00 00 00 1a   | correction       | 26                     |
   |       |               |                  |                        |
   |       |               | leapsecond[26]   |                        |
   | 262   | 58 68 46 9a   | occurrence       | 1483228826             |
   |       |               |                  | (2016-12-31T23:59:60Z) |
   | 266   | 00 00 00 1b   | correction       | 27                     |
   |       |               |                  |                        |
   | 270   | 00            | UT/local[0]      | 0 (local)              |
   |       |               |                  |                        |
   | 271   | 00            | standard/wall[0] | 0 (wall)               |
   +-------+---------------+------------------+------------------------+
        
   |       |               | leapsecond[23]   |                        |
   | 238   | 49 5c 07 97   | occurrence       | 1230768023             |
   |       |               |                  | (2008-12-31T23:59:60Z) |
   | 242   | 00 00 00 18   | correction       | 24                     |
   |       |               |                  |                        |
   |       |               | leapsecond[24]   |                        |
   | 246   | 4f ef 93 18   | occurrence       | 1341100824             |
   |       |               |                  | (2012-06-30T23:59:60Z) |
   | 250   | 00 00 00 19   | correction       | 25                     |
   |       |               |                  |                        |
   |       |               | leapsecond[25]   |                        |
   | 254   | 55 93 2d 99   | occurrence       | 1435708825             |
   |       |               |                  | (2015-06-30T23:59:60Z) |
   | 258   | 00 00 00 1a   | correction       | 26                     |
   |       |               |                  |                        |
   |       |               | leapsecond[26]   |                        |
   | 262   | 58 68 46 9a   | occurrence       | 1483228826             |
   |       |               |                  | (2016-12-31T23:59:60Z) |
   | 266   | 00 00 00 1b   | correction       | 27                     |
   |       |               |                  |                        |
   | 270   | 00            | UT/local[0]      | 0 (local)              |
   |       |               |                  |                        |
   | 271   | 00            | standard/wall[0] | 0 (wall)               |
   +-------+---------------+------------------+------------------------+
        

To determine TAI corresponding to 2000-01-01T00:00:00Z (UNIX time = 946684800), the following procedure would be followed:

要确定对应于2000-01-01T00:00:00Z(UNIX时间=946684800)的TAI,应遵循以下步骤:

1. Find the latest leap-second occurrence prior to the time of interest (leapsecond[21]) and note the correction value (LEAPCORR = 22).

1. 查找感兴趣时间之前的最新闰秒(闰秒[21]),并记下校正值(LEAPCORR=22)。

2. Add LEAPCORR + 10 to the time of interest to yield TAI of 2000-01-01T00:00:32.

2. 将LEAPCORR+10添加到利息时间,以产生2000-01-01T00:00:32的TAI。

B.2. Version 2 File Representing Pacific/Honolulu
B.2. 代表太平洋/檀香山的版本2文件
   +--------+--------------+------------------+------------------------+
   | File   | Hexadecimal  | Record Name /    | Field Value            |
   | Offset | Octets       | Field Name       |                        |
   +--------+--------------+------------------+------------------------+
   | 000    | 54 5a 69 66  | magic            | "TZif"                 |
   | 004    | 32           | version          | '2' (2)                |
   | 005    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 020    | 00 00 00 06  | isutccnt         | 6                      |
   | 024    | 00 00 00 06  | isstdcnt         | 6                      |
   | 028    | 00 00 00 00  | isleapcnt        | 0                      |
   | 032    | 00 00 00 07  | timecnt          | 7                      |
   | 036    | 00 00 00 06  | typecnt          | 6                      |
   | 040    | 00 00 00 14  | charcnt          | 20                     |
   |        |              |                  |                        |
   | 044    | 80 00 00 00  | trans time[0]    | -2147483648            |
   |        |              |                  | (1901-12-13T20:45:52Z) |
   | 048    | bb 05 43 48  | trans time[1]    | -1157283000            |
   |        |              |                  | (1933-04-30T12:30:00Z) |
   | 052    | bb 21 71 58  | trans time[2]    | -1155436200            |
   |        |              |                  | (1933-05-21T21:30:00Z) |
   | 056    | cb 89 3d c8  | trans time[3]    | -880198200             |
   |        |              |                  | (1942-02-09T12:30:00Z) |
   | 060    | d2 23 f4 70  | trans time[4]    | -769395600             |
   |        |              |                  | (1945-08-14T23:00:00Z) |
   | 064    | d2 61 49 38  | trans time[5]    | -765376200             |
   |        |              |                  | (1945-09-30T11:30:00Z) |
   | 068    | d5 8d 73 48  | trans time[6]    | -712150200             |
   |        |              |                  | (1947-06-08T12:30:00Z) |
   |        |              |                  |                        |
   | 072    | 01           | trans type[0]    | 1                      |
   | 073    | 02           | trans type[1]    | 2                      |
   | 074    | 01           | trans type[2]    | 1                      |
   | 075    | 03           | trans type[3]    | 3                      |
   | 076    | 04           | trans type[4]    | 4                      |
   | 077    | 01           | trans type[5]    | 1                      |
   | 078    | 05           | trans type[6]    | 5                      |
   |        |              |                  |                        |
   |        |              | localtimetype[0] |                        |
   | 079    | ff ff 6c 02  | utcoff           | -37886 (-10:21:26)     |
   | 083    | 00           | isdst            | 0 (no)                 |
   | 084    | 00           | desigidx         | 0                      |
   |        |              |                  |                        |
        
   +--------+--------------+------------------+------------------------+
   | File   | Hexadecimal  | Record Name /    | Field Value            |
   | Offset | Octets       | Field Name       |                        |
   +--------+--------------+------------------+------------------------+
   | 000    | 54 5a 69 66  | magic            | "TZif"                 |
   | 004    | 32           | version          | '2' (2)                |
   | 005    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 020    | 00 00 00 06  | isutccnt         | 6                      |
   | 024    | 00 00 00 06  | isstdcnt         | 6                      |
   | 028    | 00 00 00 00  | isleapcnt        | 0                      |
   | 032    | 00 00 00 07  | timecnt          | 7                      |
   | 036    | 00 00 00 06  | typecnt          | 6                      |
   | 040    | 00 00 00 14  | charcnt          | 20                     |
   |        |              |                  |                        |
   | 044    | 80 00 00 00  | trans time[0]    | -2147483648            |
   |        |              |                  | (1901-12-13T20:45:52Z) |
   | 048    | bb 05 43 48  | trans time[1]    | -1157283000            |
   |        |              |                  | (1933-04-30T12:30:00Z) |
   | 052    | bb 21 71 58  | trans time[2]    | -1155436200            |
   |        |              |                  | (1933-05-21T21:30:00Z) |
   | 056    | cb 89 3d c8  | trans time[3]    | -880198200             |
   |        |              |                  | (1942-02-09T12:30:00Z) |
   | 060    | d2 23 f4 70  | trans time[4]    | -769395600             |
   |        |              |                  | (1945-08-14T23:00:00Z) |
   | 064    | d2 61 49 38  | trans time[5]    | -765376200             |
   |        |              |                  | (1945-09-30T11:30:00Z) |
   | 068    | d5 8d 73 48  | trans time[6]    | -712150200             |
   |        |              |                  | (1947-06-08T12:30:00Z) |
   |        |              |                  |                        |
   | 072    | 01           | trans type[0]    | 1                      |
   | 073    | 02           | trans type[1]    | 2                      |
   | 074    | 01           | trans type[2]    | 1                      |
   | 075    | 03           | trans type[3]    | 3                      |
   | 076    | 04           | trans type[4]    | 4                      |
   | 077    | 01           | trans type[5]    | 1                      |
   | 078    | 05           | trans type[6]    | 5                      |
   |        |              |                  |                        |
   |        |              | localtimetype[0] |                        |
   | 079    | ff ff 6c 02  | utcoff           | -37886 (-10:21:26)     |
   | 083    | 00           | isdst            | 0 (no)                 |
   | 084    | 00           | desigidx         | 0                      |
   |        |              |                  |                        |
        
   |        |              | localtimetype[1] |                        |
   | 085    | ff ff 6c 58  | utcoff           | -37800 (-10:30)        |
   | 089    | 00           | isdst            | 0 (no)                 |
   | 090    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   |        |              | localtimetype[2] |                        |
   | 091    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 095    | 01           | isdst            | 1 (yes)                |
   | 096    | 08           | desigidx         | 8                      |
   |        |              |                  |                        |
   |        |              | localtimetype[3] |                        |
   | 097    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 101    | 01           | isdst            | 1 (yes)                |
   | 102    | 0c           | desigidx         | 12                     |
   |        |              |                  |                        |
   |        |              | localtimetype[4] |                        |
   | 103    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 107    | 01           | isdst            | 1 (yes)                |
   | 108    | 10           | desigidx         | 16                     |
   |        |              |                  |                        |
   |        |              | localtimetype[5] |                        |
   | 109    | ff ff 73 60  | utcoff           | -36000 (-10:00)        |
   | 113    | 00           | isdst            | 0 (no)                 |
   | 114    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   | 115    | 4c 4d 54 00  | designations[0]  | "LMT"                  |
   | 119    | 48 53 54 00  | designations[4]  | "HST"                  |
   | 123    | 48 44 54 00  | designations[8]  | "HDT"                  |
   | 127    | 48 57 54 00  | designations[12] | "HWT"                  |
   | 131    | 48 50 54 00  | designations[16] | "HPT"                  |
   |        |              |                  |                        |
   | 135    | 00           | UT/local[0]      | 1 (UT)                 |
   | 136    | 00           | UT/local[1]      | 0 (local)              |
   | 137    | 00           | UT/local[2]      | 0 (local)              |
   | 138    | 00           | UT/local[3]      | 0 (local)              |
   | 139    | 01           | UT/local[4]      | 1 (UT)                 |
   | 140    | 00           | UT/local[5]      | 0 (local)              |
   |        |              |                  |                        |
   | 141    | 00           | standard/wall[0] | 1 (standard)           |
   | 142    | 00           | standard/wall[1] | 0 (wall)               |
   | 143    | 00           | standard/wall[2] | 0 (wall)               |
   | 144    | 00           | standard/wall[3] | 0 (wall)               |
   | 145    | 01           | standard/wall[4] | 1 (standard)           |
   | 146    | 00           | standard/wall[5] | 0 (wall)               |
   |        |              |                  |                        |
   | 147    | 54 5a 69 66  | magic            | "TZif"                 |
   | 151    | 32           | version          | '2' (2)                |
        
   |        |              | localtimetype[1] |                        |
   | 085    | ff ff 6c 58  | utcoff           | -37800 (-10:30)        |
   | 089    | 00           | isdst            | 0 (no)                 |
   | 090    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   |        |              | localtimetype[2] |                        |
   | 091    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 095    | 01           | isdst            | 1 (yes)                |
   | 096    | 08           | desigidx         | 8                      |
   |        |              |                  |                        |
   |        |              | localtimetype[3] |                        |
   | 097    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 101    | 01           | isdst            | 1 (yes)                |
   | 102    | 0c           | desigidx         | 12                     |
   |        |              |                  |                        |
   |        |              | localtimetype[4] |                        |
   | 103    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 107    | 01           | isdst            | 1 (yes)                |
   | 108    | 10           | desigidx         | 16                     |
   |        |              |                  |                        |
   |        |              | localtimetype[5] |                        |
   | 109    | ff ff 73 60  | utcoff           | -36000 (-10:00)        |
   | 113    | 00           | isdst            | 0 (no)                 |
   | 114    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   | 115    | 4c 4d 54 00  | designations[0]  | "LMT"                  |
   | 119    | 48 53 54 00  | designations[4]  | "HST"                  |
   | 123    | 48 44 54 00  | designations[8]  | "HDT"                  |
   | 127    | 48 57 54 00  | designations[12] | "HWT"                  |
   | 131    | 48 50 54 00  | designations[16] | "HPT"                  |
   |        |              |                  |                        |
   | 135    | 00           | UT/local[0]      | 1 (UT)                 |
   | 136    | 00           | UT/local[1]      | 0 (local)              |
   | 137    | 00           | UT/local[2]      | 0 (local)              |
   | 138    | 00           | UT/local[3]      | 0 (local)              |
   | 139    | 01           | UT/local[4]      | 1 (UT)                 |
   | 140    | 00           | UT/local[5]      | 0 (local)              |
   |        |              |                  |                        |
   | 141    | 00           | standard/wall[0] | 1 (standard)           |
   | 142    | 00           | standard/wall[1] | 0 (wall)               |
   | 143    | 00           | standard/wall[2] | 0 (wall)               |
   | 144    | 00           | standard/wall[3] | 0 (wall)               |
   | 145    | 01           | standard/wall[4] | 1 (standard)           |
   | 146    | 00           | standard/wall[5] | 0 (wall)               |
   |        |              |                  |                        |
   | 147    | 54 5a 69 66  | magic            | "TZif"                 |
   | 151    | 32           | version          | '2' (2)                |
        
   | 152    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 167    | 00 00 00 06  | isutccnt         | 6                      |
   | 171    | 00 00 00 06  | isstdcnt         | 6                      |
   | 175    | 00 00 00 00  | isleapcnt        | 0                      |
   | 179    | 00 00 00 07  | timecnt          | 7                      |
   | 183    | 00 00 00 06  | typecnt          | 6                      |
   | 187    | 00 00 00 14  | charcnt          | 20                     |
   |        |              |                  |                        |
   | 191    | ff ff ff ff  | trans time[0]    | -2334101314            |
   |        | 74 e0 70 be  |                  | (1896-01-13T22:31:26Z) |
   | 199    | ff ff ff ff  | trans time[1]    | -1157283000            |
   |        | bb 05 43 48  |                  | (1933-04-30T12:30:00Z) |
   | 207    | ff ff ff ff  | trans time[2]    | -1155436200            |
   |        | bb 21 71 58  |                  | (1933-05-21T21:30:00Z) |
   | 215    | ff ff ff ff  | trans time[3]    | -880198200             |
   |        | cb 89 3d c8  |                  | (1942-02-09T12:30:00Z) |
   | 223    | ff ff ff ff  | trans time[4]    | -769395600             |
   |        | d2 23 f4 70  |                  | (1945-08-14T23:00:00Z) |
   | 231    | ff ff ff ff  | trans time[5]    | -765376200             |
   |        | d2 61 49 38  |                  | (1945-09-30T11:30:00Z) |
   | 239    | ff ff ff ff  | trans time[6]    | -712150200             |
   |        | d5 8d 73 48  |                  | (1947-06-08T12:30:00Z) |
   |        |              |                  |                        |
   | 247    | 01           | trans type[0]    | 1                      |
   | 248    | 02           | trans type[1]    | 2                      |
   | 249    | 01           | trans type[2]    | 1                      |
   | 250    | 03           | trans type[3]    | 3                      |
   | 251    | 04           | trans type[4]    | 4                      |
   | 252    | 01           | trans type[5]    | 1                      |
   | 253    | 05           | trans type[6]    | 5                      |
   |        |              |                  |                        |
   |        |              | localtimetype[0] |                        |
   | 254    | ff ff 6c 02  | utcoff           | -37886 (-10:21:26)     |
   | 258    | 00           | isdst            | 0 (no)                 |
   | 259    | 00           | desigidx         | 0                      |
   |        |              |                  |                        |
   |        |              | localtimetype[1] |                        |
   | 260    | ff ff 6c 58  | utcoff           | -37800 (-10:30)        |
   | 264    | 00           | isdst            | 0 (no)                 |
   | 265    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   |        |              | localtimetype[2] |                        |
   | 266    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 270    | 01           | isdst            | 1 (yes)                |
   | 271    | 08           | desigidx         | 8                      |
        
   | 152    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 167    | 00 00 00 06  | isutccnt         | 6                      |
   | 171    | 00 00 00 06  | isstdcnt         | 6                      |
   | 175    | 00 00 00 00  | isleapcnt        | 0                      |
   | 179    | 00 00 00 07  | timecnt          | 7                      |
   | 183    | 00 00 00 06  | typecnt          | 6                      |
   | 187    | 00 00 00 14  | charcnt          | 20                     |
   |        |              |                  |                        |
   | 191    | ff ff ff ff  | trans time[0]    | -2334101314            |
   |        | 74 e0 70 be  |                  | (1896-01-13T22:31:26Z) |
   | 199    | ff ff ff ff  | trans time[1]    | -1157283000            |
   |        | bb 05 43 48  |                  | (1933-04-30T12:30:00Z) |
   | 207    | ff ff ff ff  | trans time[2]    | -1155436200            |
   |        | bb 21 71 58  |                  | (1933-05-21T21:30:00Z) |
   | 215    | ff ff ff ff  | trans time[3]    | -880198200             |
   |        | cb 89 3d c8  |                  | (1942-02-09T12:30:00Z) |
   | 223    | ff ff ff ff  | trans time[4]    | -769395600             |
   |        | d2 23 f4 70  |                  | (1945-08-14T23:00:00Z) |
   | 231    | ff ff ff ff  | trans time[5]    | -765376200             |
   |        | d2 61 49 38  |                  | (1945-09-30T11:30:00Z) |
   | 239    | ff ff ff ff  | trans time[6]    | -712150200             |
   |        | d5 8d 73 48  |                  | (1947-06-08T12:30:00Z) |
   |        |              |                  |                        |
   | 247    | 01           | trans type[0]    | 1                      |
   | 248    | 02           | trans type[1]    | 2                      |
   | 249    | 01           | trans type[2]    | 1                      |
   | 250    | 03           | trans type[3]    | 3                      |
   | 251    | 04           | trans type[4]    | 4                      |
   | 252    | 01           | trans type[5]    | 1                      |
   | 253    | 05           | trans type[6]    | 5                      |
   |        |              |                  |                        |
   |        |              | localtimetype[0] |                        |
   | 254    | ff ff 6c 02  | utcoff           | -37886 (-10:21:26)     |
   | 258    | 00           | isdst            | 0 (no)                 |
   | 259    | 00           | desigidx         | 0                      |
   |        |              |                  |                        |
   |        |              | localtimetype[1] |                        |
   | 260    | ff ff 6c 58  | utcoff           | -37800 (-10:30)        |
   | 264    | 00           | isdst            | 0 (no)                 |
   | 265    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   |        |              | localtimetype[2] |                        |
   | 266    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 270    | 01           | isdst            | 1 (yes)                |
   | 271    | 08           | desigidx         | 8                      |
        
   |        |              |                  |                        |
   |        |              | localtimetype[3] |                        |
   | 272    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 276    | 01           | isdst            | 1 (yes)                |
   | 277    | 0c           | desigidx         | 12                     |
   |        |              |                  |                        |
   |        |              | localtimetype[4] |                        |
   | 278    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 282    | 01           | isdst            | 1 (yes)                |
   | 283    | 10           | desigidx         | 16                     |
   |        |              |                  |                        |
   |        |              | localtimetype[5] |                        |
   | 284    | ff ff 73 60  | utcoff           | -36000 (-10:00)        |
   | 288    | 00           | isdst            | 0 (no)                 |
   | 289    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   | 290    | 4c 4d 54 00  | designations[0]  | "LMT"                  |
   | 294    | 48 53 54 00  | designations[4]  | "HST"                  |
   | 298    | 48 44 54 00  | designations[8]  | "HDT"                  |
   | 302    | 48 57 54 00  | designations[12] | "HWT"                  |
   | 306    | 48 50 54 00  | designations[16] | "HPT"                  |
   |        |              |                  |                        |
   | 310    | 00           | UT/local[0]      | 0 (local)              |
   | 311    | 00           | UT/local[1]      | 0 (local)              |
   | 312    | 00           | UT/local[2]      | 0 (local)              |
   | 313    | 00           | UT/local[3]      | 0 (local)              |
   | 314    | 01           | UT/local[4]      | 1 (UT)                 |
   | 315    | 00           | UT/local[5]      | 0 (local)              |
   |        |              |                  |                        |
   | 316    | 00           | standard/wall[0] | 0 (wall)               |
   | 317    | 00           | standard/wall[1] | 0 (wall)               |
   | 318    | 00           | standard/wall[2] | 0 (wall)               |
   | 319    | 00           | standard/wall[3] | 0 (wall)               |
   | 320    | 01           | standard/wall[4] | 1 (standard)           |
   | 321    | 00           | standard/wall[5] | 0 (wall)               |
   |        |              |                  |                        |
   | 322    | 0a           | NL               | '\n'                   |
   | 323    | 48 53 54 31  | TZ string        | "HST10"                |
   |        | 30           |                  |                        |
   | 328    | 0a           | NL               | '\n'                   |
   +--------+--------------+------------------+------------------------+
        
   |        |              |                  |                        |
   |        |              | localtimetype[3] |                        |
   | 272    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 276    | 01           | isdst            | 1 (yes)                |
   | 277    | 0c           | desigidx         | 12                     |
   |        |              |                  |                        |
   |        |              | localtimetype[4] |                        |
   | 278    | ff ff 7a 68  | utcoff           | -34200 (-09:30)        |
   | 282    | 01           | isdst            | 1 (yes)                |
   | 283    | 10           | desigidx         | 16                     |
   |        |              |                  |                        |
   |        |              | localtimetype[5] |                        |
   | 284    | ff ff 73 60  | utcoff           | -36000 (-10:00)        |
   | 288    | 00           | isdst            | 0 (no)                 |
   | 289    | 04           | desigidx         | 4                      |
   |        |              |                  |                        |
   | 290    | 4c 4d 54 00  | designations[0]  | "LMT"                  |
   | 294    | 48 53 54 00  | designations[4]  | "HST"                  |
   | 298    | 48 44 54 00  | designations[8]  | "HDT"                  |
   | 302    | 48 57 54 00  | designations[12] | "HWT"                  |
   | 306    | 48 50 54 00  | designations[16] | "HPT"                  |
   |        |              |                  |                        |
   | 310    | 00           | UT/local[0]      | 0 (local)              |
   | 311    | 00           | UT/local[1]      | 0 (local)              |
   | 312    | 00           | UT/local[2]      | 0 (local)              |
   | 313    | 00           | UT/local[3]      | 0 (local)              |
   | 314    | 01           | UT/local[4]      | 1 (UT)                 |
   | 315    | 00           | UT/local[5]      | 0 (local)              |
   |        |              |                  |                        |
   | 316    | 00           | standard/wall[0] | 0 (wall)               |
   | 317    | 00           | standard/wall[1] | 0 (wall)               |
   | 318    | 00           | standard/wall[2] | 0 (wall)               |
   | 319    | 00           | standard/wall[3] | 0 (wall)               |
   | 320    | 01           | standard/wall[4] | 1 (standard)           |
   | 321    | 00           | standard/wall[5] | 0 (wall)               |
   |        |              |                  |                        |
   | 322    | 0a           | NL               | '\n'                   |
   | 323    | 48 53 54 31  | TZ string        | "HST10"                |
   |        | 30           |                  |                        |
   | 328    | 0a           | NL               | '\n'                   |
   +--------+--------------+------------------+------------------------+
        

To determine the local time in this time zone corresponding to 1933-05-04T12:00:00Z (UNIX time = -1156939200), the following procedure would be followed:

要确定该时区中与1933-05-04T12:00:00Z(UNIX时间=-1156939200)相对应的本地时间,应遵循以下步骤:

1. Find the latest time transition prior to the time of interest (trans time[1]).

1. 查找感兴趣时间之前的最新时间转换(trans time[1])。

2. Reference the corresponding transition type (trans type[1]) to determine the local time type index (2).

2. 参考相应的转换类型(转换类型[1])以确定本地时间类型索引(2)。

3. Reference the corresponding local time type (localtimetype[2]) to determine the offset from UTC (-09:30), the daylight saving indicator (1 = yes), and the index into the time zone designation strings (8).

3. 参考相应的本地时间类型(localtimetype[2])以确定与UTC(-09:30)的偏移量、夏令时指示器(1=是)以及时区指定字符串(8)中的索引。

4. Look up the corresponding time zone designation string (designations[8] = "HDT").

4. 查找相应的时区指定字符串(指定[8]=“HDT”)。

5. Add the UTC offset to the time of interest to yield a local daylight saving time of 1933-05-04T02:30:00-09:30 (HDT).

5. 将UTC偏移量添加到感兴趣的时间,以产生1933-05-04T02:30:00-09:30(HDT)的本地夏令时。

To determine the local time in this time zone corresponding to 2019-01-01T00:00:00Z (UNIX time = 1546300800), the following procedure would be followed:

要确定该时区中对应于2019-01-01T00:00:00Z(UNIX时间=154630800)的本地时间,将遵循以下程序:

1. Find the latest time transition prior to the time of interest (there is no such transition).

1. 查找感兴趣时间之前的最新时间转换(不存在此类转换)。

2. Look up the TZ string in the footer ("HST10"), which indicates that the time zone designation is "HST" year-round, and the offset to UTC is 10:00.

2. 在页脚(“HST10”)中查找TZ字符串,它表示时区名称为全年“HST”,UTC的偏移量为10:00。

3. Subtract the UTC offset from the time of interest to yield a standard local time of 2018-12-31T14:00:00-10:00 (HST).

3. 从关注时间中减去UTC偏移量,得出标准本地时间2018-12-31T14:00:00-10:00(HST)。

B.3. Truncated Version 3 File Representing Asia/Jerusalem
B.3. 代表亚洲/耶路撒冷的截断版本3文件

The following TZif file has been truncated to start on 2038-01-01T00:00:00Z.

以下TZif文件已被截断,从2038-01-01T00:00:00Z开始。

   +--------+--------------+------------------+------------------------+
   | File   | Hexadecimal  | Record Name /    | Field Value            |
   | Offset | Octets       | Field Name       |                        |
   +--------+--------------+------------------+------------------------+
   | 000    | 54 5a 69 66  | magic            | "TZif"                 |
   | 004    | 33           | version          | '3' (3)                |
   | 005    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 020    | 00 00 00 00  | isutccnt         | 0                      |
   | 024    | 00 00 00 00  | isstdcnt         | 0                      |
   | 028    | 00 00 00 00  | isleapcnt        | 0                      |
   | 032    | 00 00 00 00  | timecnt          | 0                      |
   | 036    | 00 00 00 00  | typecnt          | 0                      |
   | 040    | 00 00 00 00  | charcnt          | 0                      |
   |        |              |                  |                        |
   | 044    | 54 5a 69 66  | magic            | "TZif"                 |
   | 048    | 33           | version          | '3' (3)                |
   | 049    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 064    | 00 00 00 03  | isutccnt         | 1                      |
   | 068    | 00 00 00 03  | isstdcnt         | 1                      |
   | 072    | 00 00 00 00  | isleapcnt        | 0                      |
   | 076    | 00 00 00 03  | timecnt          | 1                      |
   | 080    | 00 00 00 03  | typecnt          | 1                      |
   | 084    | 00 00 00 08  | charcnt          | 4                      |
   |        |              |                  |                        |
   | 088    | 00 00 00 00  | trans time[0]    | 2145916800             |
   |        | 7f e8 17 80  |                  | (2038-01-01T00:00:00Z) |
   |        |              |                  |                        |
   | 096    | 00           | trans type[0]    | 0                      |
   |        |              |                  |                        |
   |        |              | localtimetype[0] |                        |
   | 097    | 00 00 1c 20  | utcoff           | 7200 (+02:00)          |
   | 101    | 00           | isdst            | 0 (no)                 |
   | 102    | 00           | desigidx         | 0                      |
   |        |              |                  |                        |
   | 103    | 49 53 54 00  | designations[0]  | "IST"                  |
   |        |              |                  |                        |
   | 107    | 01           | UT/local[0]      | 1 (UT)                 |
        
   +--------+--------------+------------------+------------------------+
   | File   | Hexadecimal  | Record Name /    | Field Value            |
   | Offset | Octets       | Field Name       |                        |
   +--------+--------------+------------------+------------------------+
   | 000    | 54 5a 69 66  | magic            | "TZif"                 |
   | 004    | 33           | version          | '3' (3)                |
   | 005    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 020    | 00 00 00 00  | isutccnt         | 0                      |
   | 024    | 00 00 00 00  | isstdcnt         | 0                      |
   | 028    | 00 00 00 00  | isleapcnt        | 0                      |
   | 032    | 00 00 00 00  | timecnt          | 0                      |
   | 036    | 00 00 00 00  | typecnt          | 0                      |
   | 040    | 00 00 00 00  | charcnt          | 0                      |
   |        |              |                  |                        |
   | 044    | 54 5a 69 66  | magic            | "TZif"                 |
   | 048    | 33           | version          | '3' (3)                |
   | 049    | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00 00  |                  |                        |
   |        | 00 00 00     |                  |                        |
   | 064    | 00 00 00 03  | isutccnt         | 1                      |
   | 068    | 00 00 00 03  | isstdcnt         | 1                      |
   | 072    | 00 00 00 00  | isleapcnt        | 0                      |
   | 076    | 00 00 00 03  | timecnt          | 1                      |
   | 080    | 00 00 00 03  | typecnt          | 1                      |
   | 084    | 00 00 00 08  | charcnt          | 4                      |
   |        |              |                  |                        |
   | 088    | 00 00 00 00  | trans time[0]    | 2145916800             |
   |        | 7f e8 17 80  |                  | (2038-01-01T00:00:00Z) |
   |        |              |                  |                        |
   | 096    | 00           | trans type[0]    | 0                      |
   |        |              |                  |                        |
   |        |              | localtimetype[0] |                        |
   | 097    | 00 00 1c 20  | utcoff           | 7200 (+02:00)          |
   | 101    | 00           | isdst            | 0 (no)                 |
   | 102    | 00           | desigidx         | 0                      |
   |        |              |                  |                        |
   | 103    | 49 53 54 00  | designations[0]  | "IST"                  |
   |        |              |                  |                        |
   | 107    | 01           | UT/local[0]      | 1 (UT)                 |
        
   |        |              |                  |                        |
   | 108    | 01           | standard/wall[0] | 1 (standard)           |
   |        |              |                  |                        |
   | 109    | 0a           | NL               | '\n'                   |
   | 110    | 49 53 54 2d  | TZ string        | "IST-2IDT,             |
   |        | 32 49 44 54  |                  | M3.4.4/26,M10.5.0"     |
   |        | 2c 4d 33 2e  |                  |                        |
   |        | 34 2e 34 2f  |                  |                        |
   |        | 32 36 2c 4d  |                  |                        |
   |        | 31 30 2e 35  |                  |                        |
   |        | 2e 30        |                  |                        |
   | 136    | 0a           | NL               | '\n'                   |
   +--------+--------------+------------------+------------------------+
        
   |        |              |                  |                        |
   | 108    | 01           | standard/wall[0] | 1 (standard)           |
   |        |              |                  |                        |
   | 109    | 0a           | NL               | '\n'                   |
   | 110    | 49 53 54 2d  | TZ string        | "IST-2IDT,             |
   |        | 32 49 44 54  |                  | M3.4.4/26,M10.5.0"     |
   |        | 2c 4d 33 2e  |                  |                        |
   |        | 34 2e 34 2f  |                  |                        |
   |        | 32 36 2c 4d  |                  |                        |
   |        | 31 30 2e 35  |                  |                        |
   |        | 2e 30        |                  |                        |
   | 136    | 0a           | NL               | '\n'                   |
   +--------+--------------+------------------+------------------------+
        

Acknowledgments

致谢

The authors would like to thank the following individuals for contributing their ideas and support for writing this specification: Michael Douglass, Ned Freed, Guy Harris, Eliot Lear, and Alexey Melnikov.

作者要感谢以下个人为编写本规范贡献了他们的想法和支持:Michael Douglass、Ned Freed、Guy Harris、Eliot Lear和Alexey Melnikov。

Authors' Addresses

作者地址

Arthur David Olson

阿瑟·大卫·奥尔森

   Email: arthurdavidolson@gmail.com
        
   Email: arthurdavidolson@gmail.com
        

Paul Eggert University of California, Los Angeles

洛杉矶保罗加利福尼亚大学

   Email: eggert@cs.ucla.edu
        
   Email: eggert@cs.ucla.edu
        

Kenneth Murchison FastMail US LLC

肯尼斯·默奇森快捷邮件美国有限责任公司

   Email: murch@fastmailteam.com
        
   Email: murch@fastmailteam.com