Tzdata - Global Time Zone Knowledge Base

    If somewhere (for example, in some applications) we need to work not only with universal time UTC, but also with local time at different points on the Earth, then the question arises of the need for some kind of knowledge base on how local time is calculated relative to UTC in various regions of the world.

    Many Unix-like systems use tzdata to store information about all world time zones (it’s tz database, it’s also zoneinfo database, it’s also Olson database in honor of Arthur Olson, the founder of this knowledge base).

    For the first time, Arthur David Olson began to collect this base (Arthur David Olson), later other participants joined this project. Now the main committer of new information in the tzdata database is Paul Eggert, and Arthur Olson is now developing and supporting utilities for working with local time and time zone data (tzcode package).

    The tzdata database contains detailed information about all time zones in all regions of the world:
    - coordinate reference of the main settlements characterizing the time zone;
    - local time offset in various regions relative to universal time UTC;
    - it is indicated in which regions daylight saving time (DST) is applied, how much it shifts relative to the standard, the exact dates and times for switching to daylight saving time and back in different regions for different periods are indicated;
    - information about leap seconds ( leap seconds ).

    An important feature of the tzdata database is that it not only stores the current state of all world time zones (i.e. the current rules for calculating local time relative to UTC in each region of the world), it also stores all changes to these rules for calculating local time for all regions for all the time since the beginning of the Unix era (January 1, 1970). Suppose a country by its political decision moved to a different time zone - this information is in tzdata accurate to the second when it happened; some country has changed the daylight saving time - this information is in tzdata accurate to the second when it happened; some country canceled daylight saving - this information is in tzdata accurate to the second when it happened, etc.

    Due to this feature, it is possible to conduct accurate time calculations for different countries at different time intervals.

    For example, the local time:
    2010-12-01 14:00 hours (MSK) - corresponds 2010-12-01 11 : 00 (UTC)
    2011-12-01 14:00 hours (MSK) - corresponds 2011-12-01 10 : 00 (UTC)
    It would seem that the same time zone name and the same local time (only a different year). But in one historical period, the MSK time zone corresponded to UTC + 03: 00, and in another historical period, the same MSK time zone corresponded to UTC + 04: 00.
    And thanks to the tzdata base, all these ambiguities are easily resolved, because it stores detailed information about when and how time was calculated in each of the time zones in each of the time periods (since 1970).

    If you have only the current state of all time zones (without historical memory), then such ambiguities of local time zones will never be resolved. And the tzdata database just solves the problem of collecting and consolidating all this information about time zones from around the world.

    Information on calculating time in different regions of the world for the tzdata database is collected jointly by participants of the opensource community from all over the world, then the sent information is checked, discussed, updated, consolidated and eventually committed to tzdata files. The tzdata sources contain all information about all time zones in a human-readable text format with comments and explanations. Further, these text files are compiled (by the zic utility ) and are already used in systems in compiled binary form. Moreover, the compiled tzdata files, although binary, do not contain executable code and are platform independent. On most unix-like operating systems, compiled timezone files from the tzdata package can be found here:/usr/share/zoneinfo/

    The name of the time zones in the tzdata database is indicated in the format Area / Location (Region / City), for example, Europe / Moscow, Europe / Minsk, Asia / Omsk, Asia / Magadan, America / New_York, etc.
    A complete list of world locations (with a coordinate reference) with which world time zones are associated can be found in the zone.tab file, which is usually located in the tzdata directory: /usr/share/zoneinfo/zone.tab

    Official resources of the tzdata project:
    HTTP: http://cs.ucla.edu/~ eggert / tz /
    FTP :: ftp://elsie.nci.nih.gov/pub/
    (FTP server is temporarily closed during the trial ).

    Tzdata project files on official ICANN servers:
    HTTP: http://www.iana.org/time-zones
    FTP: ftp://ftp.iana.org/tz/
    Rsync: rsync: //rsync.iana.org/tz/

    Temporary mirrors of the tzdata project:
    http:
    http://www.twinsun.com/tz/tz-link.htm
    http://tzmirror.appealingapps.de/
    http://tzmirror.sunbase.org/
    http: // www. mailstation.de/tzmirror/
    http://www.foo.be/mirrors/tzmirror/
    http://www.localhost.lu/mirrors/tzmirror/
    FTP:
    ftp://tzmirror.appealingapps.de
    ftp: // munnari .oz.au / pub The

    information collected in tzdata is freely distributed to all comers without any licensing restrictions (public domain). Anyone can freely take it (both in source and in binary form) and use it in their applications / libraries / services. And many developers / vendors of OS distributions (in particular Linux / BSD / MacOS) and various software do just that.

    In the world of opensource (and not only), the tzdata database is de facto a standard source of information about all world time zones and the history of their changes. The tzdata database is used by all GNU / Linux distributions, BSD systems (FreeBSD, NetBSD, OpenBSD, DragonFly BSD), Solaris, UnixWare, AIX (6.1 and higher), Cygwin as well as Mac OS X and some other unix-like distributions. Mobile OS: Android, Apple iOS, Maemo / MeeGo also use tzdata. In addition, data from tzdata is used in a number of DBMSs: MySQL, Oracle DB, PostgreSQL, etc., as well as in various languages, frameworks, libraries, modules: PHP5, Perl (modules DateTime :: TimeZone and DateTime :: LeapSecond), Python (pytz module), GNU C Library (glibc), .NET Framework (zoneinfo module), Java Runtime Environment, etc.

    Thanks to the unified global knowledge base tzdata, each OS and software developer does not need to independently collect and keep up to date information on world time zones inside his project. Everyone gets it from a single source, and everywhere it is identical (if tzdata is updated on time).

    Tzdata versions are numbered as follows. First, a four-digit number, indicating the year of release of this version, and then one letter of the Latin alphabet in order: a, b, c, d ... etc. as new tzdata releases in one year. For example, in 2010 there were tzdata versions: 2010a, 2010b, 2010c ... and further up to version 2010o. In 2011, tzdata versions were released: 2011a, 2011b, 2011c ... and further until 2011l (as of the date of writing this article, this is the latest version of tzdata so far).

    If you use any Linux distribution that you regularly update from repositories, then most likely the latest version of the tzdata package is already installed on your system.
    The release dates of several recent tzdata releases using Ubuntu as an example:
    September 12, 2011 - tzdata sources have been updated to version 2011j;
    September 14, 2011 - tzdata package was updated to version 2011j in the upstream Ubuntu (Debian Unstable);
    September 20, 2011 - the tzdata 2011j package was delivered to the main Ubuntu repository;
    September 26, 2011 - tzdata sources were updated to version 2011k;
    September 26, 2011 - tzdata package was updated to version 2011k in the upstream Ubuntu (Debian Unstable);
    October 4, 2011 - the tzdata 2011k package arrived in the main Ubuntu repository;
    October 10, 2011 - tzdata sources were updated to version 2011l (at the time of writing, there were no packages for Ubuntu yet).

    On Linux distributions with package managers, you can simply see the version of the currently installed tzdata package. For example, in Debian / Ubuntu, you can do this with the command:
    dpkg -s tzdata |grep Version

    If you need to use information about time zones and local time in different regions in your projects, then I recommend that you use the tzdata base for these purposes, and not reinvent your bicycle. This will help you, firstly, to save time, and secondly, to always have an up-to-date base of the history of changes in world time zones for accurate calculations with local time in the present and past.

    Legal difficulties of the tzdata project


    September 30, 2011 - A civil lawsuit was filed with the US federal court in Boston over the illegal use in tzdata of information taken from the ACS Atlas / ACS International Atlas / ACS American Atlas software products that Astrolabe, Inc. distributed under a commercial license, and to which it has intellectual rights.
    Plaintiff in this case: Astrolabe, Inc.
    Defendants: Arthur David Olson and Paul Eggert (Maintainers and Project Coordinators of tzdata).
    (a topic on Habré about it)

    October 6, 2011 - Arthur David Olson on the mailing lists of the tzdata project (Newsgroups: gmane.comp.time.tz) reportedthat, in connection with this prosecution, he is forced, just in case, to the decision of the court, to stop the official FTP server with all files of the tzdata project.
    Immediately afterwards, other tzdata project participants opened several temporary HTTP / FTP mirrors so that anyone can access these files (see the temporary mirrors of the tzdata project above )

    October 14, 2011 - ICANN released a press release ( PDF ) in which she said that they had received an offer to support the TZ Database (tzdata) project and announced that they would take over the support of the tzdata project for the time being.
    The future development and support of a single global standardized database of time zones will be governed by a document that is already being developed by the IETF . A draft of this document can be found here:
    tools.ietf.org/html/draft-lear-iana-timezone-database-04

    The trial in this case has not yet been completed (at the time of this writing).

     
    CC BY License logo
    Article author: Roman Tick
    The text of the article is licensed under Creative Commons Attribution 3.0 Unported (CC BY 3.0). You can freely copy, edit and use this text for any purpose with the obligatory indication of authorship.

    Also popular now: