Sources for Time Zone and Daylight Saving Time Data from tz

Created by: Administrator, Last modification: Thu 23 of Jan, 2014 (20:27 UTC)

The tz database

The public-domain time zone database contains code and data that represent the history of local time for many representative locations around the globe. It is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. This database (often called zoneinfo or tz) is used by several implementations, including the GNU C Library (used in GNU/Linux), Android, Firefox OS, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, webOS, AIX, BlackBerry 10, iOS, Microsoft Windows, OpenVMS, Oracle Database, OS X, and Solaris.

Each location in the database represents a national region where all clocks keeping local time have agreed since 1970. Locations are identified by continent or ocean and then by the name of the location, which is typically the largest city within the region. For example, America/New_York represents most of the US eastern time zone; America/Phoenix represents most of Arizona, which uses mountain time without daylight saving time (DST); America/Detroit represents most of Michigan, which uses eastern time but with different DST rules in 1975; and other entries represent smaller regions like Starke County, Indiana, which switched from central to eastern time in 1991 and switched back in 2006. To use the database on an extended POSIX implementation set the TZ environment variable to the location's full name, e.g., TZ="America/New_York".

In the tz database's FTP releases the code is in the file tzcodeC.tar.gz, where C is the code's version; similarly, the data are in tzdataD.tar.gz, where D is the data's version. Each version is a four-digit year followed by lower-case letters (a through z, then za through zz, then zza through zzz, and so on). Convenience links to the latest code and latest data revisions are also available. The following shell commands download these files to a GNU/Linux or similar host; see the downloaded README file for what to do next.

<code>mkdir tz
cd tz
<a href="http://www.gnu.org/software/wget/">wget</a> --retr-symlinks
&#39;ftp://ftp.iana.org/tz/tz*-latest.tar.gz&#39;
<a href="http://www.gnu.org/software/gzip/">gzip</a> -dc tzcode-latest.tar.gz |
<a href="http://www.gnu.org/software/tar/">tar</a> -xf -
gzip -dc tzdata-latest.tar.gz | tar -xf -
</code>

The code and data files can also be obtained from the Time Zone Database website of the Internet Assigned Numbers Authority (IANA). An unofficial development repository of the code and data is available in Git form from GitHub; be careful, as this repository is less well tested and probably contains more errors.

The code lets you compile the tz source files into machine-readable binary files, one for each location. It also lets you read a tz binary file and interpret time stamps for that location.

The data are by no means authoritative. If you find errors, please send changes to the time zone mailing list. You can also browse recent messages sent to the mailing list, subscribe to it, and browse the archive of old messages. For further information about updates, please see Procedures for Maintaining the Time Zone Database (Internet RFC 6557).

The Web has several other sources for time zone and daylight saving time data. Here are some links that may be of interest.

Commentary on the tz database

Web sites using recent versions of the tz database

These are listed roughly in ascending order of complexity and fanciness.

Other time zone database formats

Other tz compilers

Other tz binary file readers

  • The GNU C Library has an independent, thread-safe implementation of a tz binary file reader. This library is freely available under the GNU Lesser General Public License (LGPL), and is widely used in GNU/Linux systems.
  • ZoneInfo.java is a tz binary file reader written in Java. It is freely available under the LGPL.
  • Tcl, mentioned above, also contains a tz binary file reader.
  • DateTime::TimeZone::Tzfile is a tz binary file reader written in Perl. It is freely available under the same terms as Perl (dual GPL and Artistic license).
  • The public-domain tz.js library contains a Python tool that converts tz binary data into JSON-format data suitable for use in its JavaScript library for time zone conversion. Dates before 1970 are not supported.

Other tz-based time zone software

Other time zone databases

Maps

Time zone boundaries

Civil time concepts and history

National histories of legal time

Australia

The Parliamentary Library has commissioned research note on daylight saving time in Australia. The Bureau of Meteorology publishes a list of Implementation Dates of Daylight Savings Time within Australia.

Belgium

The Royal Observatory of Belgium maintains a table of time in Belgium (in Dutch).

Brazil

The Time Service Department of the National Observatory records Brazil's daylight saving time decrees (in Portuguese).

Canada

National Research Council Canada publishes current and some older information about time zones & daylight saving time.

Chile

The Chilean Hydrographic and Oceanographic Service publishes a history of Chile's official time (in Spanish).

Germany

The National Institute for Science and Technology maintains the Realisation of Legal Time in Germany.

Israel

The Interior Ministry periodically issues announcements (in Hebrew).

Mexico

The Investigation and Analysis Service of the Mexican Library of Congress has published a history of Mexican local time (in Spanish).

Malaysia

See Singapore below.

Netherlands

Legal time in the Netherlands (in Dutch) covers the history of local time in the Netherlands from ancient times.

New Zealand

The Department of Internal Affairs maintains a brief History of Daylight Saving. The privately-maintained History of New Zealand time has more details.

Singapore

Why is Singapore in the "Wrong" Time Zone? details the history of legal time in Singapore and Malaysia.

United Kingdom

History of legal time in Britain discusses in detail the country with perhaps the best-documented history of clock adjustments. The National Physical Laboratory also maintains an Archive of Summer time dates.

Precision timekeeping

Time notation

  • A summary of the international standard date and time notation is a good summary of ISO 8601:2004 – Data elements and interchange formats – Information interchange – Representation of dates and times.
  • XML Schema: Datatypes – dateTime specifies a format inspired by ISO 8601 that is in common use in XML data.
  • Internet Message Format (Internet RFC 5322) §3.3 specifies the time notation used in email and HTTP headers.
  • Date and Time on the Internet: Timestamps (Internet RFC 3339) specifies an ISO 8601 profile for use in new Internet protocols.
  • Date & Time Formats on the Web surveys web- and Internet-oriented date and time formats.
  • The Best of Dates, the Worst of Dates covers many problems encountered by software developers when handling dates and time stamps.
  • The Unicode Common Locale Data Repository (CLDR) Project has localizations for time zone names, abbreviations, identifiers, and formats. For example, it contains French translations for "Eastern European Summer Time", "EEST", and "Bucharest". By-Type Chart shows these values for many locales. ICU contains a mechanism for using this data.
  • Alphabetic time zone abbreviations should not be used as unique identifiers for UTC offsets as they are ambiguous in practice. For example, "EST" denotes 5 hours behind UTC in English-speaking North America, but it denotes 10 or 11 hours ahead of UTC in Australia; and French-speaking North Americans prefer "HNE" to "EST". For POSIX the tz database contains English abbreviations for all time stamps but in many cases these are merely inventions of the database maintainers.
  • Numeric time zone abbreviations typically count hours east of UTC, e.g., +09 for Japan and -10 for Hawaii. However, the POSIX TZ environment variable uses the opposite convention. For example, one might use TZ="JST-9" and TZ="HST10" for Japan and Hawaii, respectively. If the tz database is available, it is usually better to use settings like TZ="Asia/Tokyo" and TZ="Pacific/Honolulu" instead, as this should avoid confusion, handle old time stamps better, and insulate you better from any future changes to the rules. One should never set POSIX TZ to a value like "GMT-9", though, since this would falsely claim that local time is nine hours ahead of UTC and the time zone is called "GMT".

Related indexes