[tz] Getting current tzdb version in use

Paul G paul at ganssle.io
Thu Jul 19 01:49:24 UTC 2018

Where is it getting the version information? The tzdb files have the `make version` target, but that is not installed with `make install`. There's also the tzdata.zi file, which has the info in the header comment, but I don't think that is consistently deployed in system packages.

On July 19, 2018 1:45:14 AM UTC, Howard Hinnant <howard.hinnant at gmail.com> wrote:
>On Jul 18, 2018, at 9:36 PM, Aldrin Martoq Ahumada
><aldrin.martoq at gmail.com> wrote:
>> Hi,
>> I was looking for a reliable way to get the current tzdb version
>(something like 2018e), but it seems it doesn’t exists yet. A couple of
>> - In Mac OS 10.13.6, there is a /usr/share/zoneinfo/+VERSION that
>says 2018c.
>> - In one of my updated Ubuntu 16.04 servers, the only reliable way is
>to do a dpkg -s tzdata | grep ^Version, and guess the real version from
>the string “Version: 2017c-0ubuntu0.16.04"
>> - The “tzinfo” ruby library can get the version only if it uses its
>own version of tzdata, if it uses the OS files, there is no string
>> Knowing the current tzdb version is essential for automating timezone
>> I think an appropriate place to put that string is in the binary TZif
>file itself, so tools like tzinfo can get the current version *of the
>current timezone in use*, instead of looking some random file like
>+VERSION in a random directory/folder.
>> Is there any chances for this to happen? Or any other suggestion?
>Fwiw, in the draft C++20 spec, this is a legal program that prints out
>what you want:
>    #include <chrono>
>    #include <iostream>
>    int
>    main()
>    {
>        std::cout << std::chrono::get_tzdb().version << '\n';
>    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20180719/70d3f27a/attachment-0001.html>

More information about the tz mailing list