If we need somewhere (for example, in some applications) to work not only with universal time UTC, but also with local time in different points of the Earth, then the question arises of the need for some kind of knowledge base about how local time is calculated relative to UTC in various regions of the world.
Many Unix-like systems use the
tzdata database to store information about all world time zones (it’s also tz database, it’s 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 collecting this base, and later other participants joined this project. Now, the main committer of the new tzdata database is Paul Eggert (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 on all time zones in all regions of the world:
- coordinate reference of the main settlements characterizing the time zone;
- local time offset in different regions relative to universal UTC time;
- it is specified in which regions summer time is used (DST), how much it shifts relative to the standard, the exact dates and time of switching to summer time and back in different regions in different periods are indicated;
- information about leap seconds (
leap seconds ).
An important feature of the tzdata database is that it does not just store the current state of all world time zones (that is, 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, with a political decision, a country has moved to a different time zone - this information is in tzdata with an accuracy of a second when it happened; some country has changed the date of daylight saving time - this information is in tzdata with an accuracy of a second when it happened; some country canceled the transition to summer time - this information is in tzdata with an accuracy of a second, when it happened, etc.
Thanks to this feature, it is possible to conduct accurate time calculations for different countries for different periods of time.
For example, local time:
2010-12-01 14:00 (MSK) - complies with 2010-12-01 11:00 (UTC)
2011-12-01 14:00 (MSK) - complies with 2011-12-01 10:00 (UTC)
It would seem that the same time zone name and the same local time (only the year is different). 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 database, all these ambiguities are easily solved, since It contains detailed information on when and how time was calculated in each of the time zones in each of the time periods (since 1970).
If you only have the current state of all time zones (without historical memory), then such ambiguities of local time zones can never be resolved. And the tzdata database solves the task of collecting and consolidating all this information about time zones from around the world.
Information on the calculation of time in different regions of the world for the tzdata database is collected jointly by the participants of the opensource community from around the world, then the sent information is checked, discussed, specified, consolidated and eventually commited into 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 used in systems already in the compiled binary form. Moreover, the compiled tzdata files, although binary, do not contain executable code and are platform independent. In most unix-like operating systems, compiled files describing time zones from the tzdata package can be found here:
/usr/share/zoneinfo/
The name of time zones in the tzdata database is specified in the Area / Location format, 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/
(The FTP server is temporarily closed for the duration of the
trial ).
Tzdata project files on ICANN official 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 distributed freely to everyone without any licensing restrictions (public domain). Anyone can freely take (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 the de facto 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 above), 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 (DateTime :: TimeZone and DateTime :: LeapSecond modules), 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 maintain up-to-date information on world time zones within his project. All of it is obtained from a single source, and everywhere it is identical (if you update tzdata in time).
Versions of tzdata 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 versions of tzdata are released within one year. For example, in 2010, tzdata versions were released: 2010a, 2010b, 2010c ... and further to version 2010o. In 2011, tzdata versions were released: 2011a, 2011b, 2011c ... and further until 2011l (at the time of this writing, this is still the latest version of tzdata).
If you use any Linux distribution that you regularly update from the 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 the example of Ubuntu:
September 12, 2011 - tzdata sources have been updated to version 2011j;
September 14, 2011 - tzdata has been updated to version 2011j in Ubuntu upstream (Debian Unstable);
September 20, 2011 - the tzdata 2011j package entered the main Ubuntu repository;
September 26, 2011 - the tzdata sources have been updated to the 2011k version;
September 26, 2011 - tzdata has been updated to version 2011k on Ubuntu upstream (Debian Unstable);
October 04, 2011 - tzdata 2011k package entered the main repository of Ubuntu;
October 10, 2011 - The tzdata sources have been updated to version 2011l (at the time of this writing, there were no packages under Ubuntu yet).
In Linux distributions with package managers, you can simply see the version of the currently installed tzdata package. For example, in Debian / Ubuntu, this can be done 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, I recommend that you use the tzdata database for this purpose, and not reinvent your bicycle. This will help you, firstly, to save time, and secondly, to always have the actual base of the history of changes in world time zones for accurate calculations with local time in the present and the past.
Legal difficulties of the tzdata project
September 30, 2011 - The US Federal Court in Boston received a civil lawsuit about the illegal use of information taken from ACS Atlas / ACS International Atlas / ACS American Atlas software, which Astrolabe, Inc. has been used in tzdata. distributed under a commercial license, and for which it has intellectual rights.
Plaintiff in this case: Astrolabe, Inc.
Respondents: Arthur David Olson and Paul Eggert (maintainers and coordinators of the tzdata project).
(
topic on Habré about it)
October 6, 2011 - Arthur David Olson on the tzdata project mailing lists (Newsgroups: gmane.comp.time.tz)
reported that due to this prosecution, he is forced, just in case, before the court’s decision to stop the operation of the official FTP server with all project files tzdata
Immediately after this, other participants of the tzdata project opened several temporary HTTP / FTP mirrors so that anyone could access these files (see above the
temporary mirrors of the tzdata project )
October 14, 2011 - The international organization
ICANN issued a press release (
PDF ), which reported that they received an offer to support the TZ Database project (tzdata) and announced that they are taking on the support of the tzdata project so far on a temporary basis.
The future development and support of a single global standardized base 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 of this case is not over yet (at the time of this writing).
 | Article author: Roman Tik <ya.roman.tik {at} yandex.ru>
The text of the article is distributed under the terms of the license Creative Commons Attribution 3.0 Unported (CC BY 3.0). You can freely copy, edit and use for any purpose this text with the obligatory indication of authorship. |