<html><head></head><body>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.<br><br><div class="gmail_quote">On July 19, 2018 1:45:14 AM UTC, Howard Hinnant <howard.hinnant@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Jul 18, 2018, at 9:36 PM, Aldrin Martoq Ahumada <aldrin.martoq@gmail.com> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <br> Hi,<br> <br> 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 examples:<br> - In Mac OS 10.13.6, there is a /usr/share/zoneinfo/+VERSION that says 2018c.<br> - 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"<br> - 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 version.<br> <br> Knowing the current tzdb version is essential for automating timezone updates.<br> <br> <br> 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.<br> <br> Is there any chances for this to happen? Or any other suggestion?<br></blockquote><br>Fwiw, in the draft C++20 spec, this is a legal program that prints out what you want:<br><br>    #include <chrono><br>    #include <iostream><br><br>    int<br>    main()<br>    {<br>        std::cout << std::chrono::get_tzdb().version << '\n';<br>    }<br><br>Howard<br><br></pre></blockquote></div></body></html>