[tz] Getting current tzdb version in use

Philip Newton philip.newton at gmail.com
Fri Jul 20 11:03:02 UTC 2018

On 19 July 2018 at 04:12, Howard Hinnant <howard.hinnant at gmail.com> wrote:
> The C++20 draft specification leaves the version unspecified, both in its content and its source.  However it is expected that the implementor will make a best attempt to track the IANA database version number.
> The prototype implementation first tries the file “version”.  If that file doesn’t exist, it tries to scrape the version number out of NEWS:
>     https://github.com/HowardHinnant/date/blob/master/src/tz.cpp#L3316-L3342
> On Apple OS's, and if using the OS-supplied zic-compiled files, “+VERSION” is used:
>     https://github.com/HowardHinnant/date/blob/master/src/tz.cpp#L2618-L2632
> std::lib implementors will be free to provide this information however they best see fit to serve their customers.  Some implementors will probably initially provide an empty string as the version, and my hope is that they will be down-voted in market share.  In time, I hope that C++ std::lib implementors will converge on supplying an accurate representation of the IANA version number, given the standard API for doing so.  Customers will have this standard API in their toolbox, and provide market pressure to their vendors for said API to supply quality results.

On 19 July 2018 at 17:39, Howard Hinnant <howard.hinnant at gmail.com> wrote:

> If every version == “unknown”, this strategy will spectacularly fail, and subsequently the std::lib vendor may as well.

That might work, if people use their C++ standard library only for tz
work, or if all implementations are identical in all respects but for
the tz portion.

But if you have implementation A with a perfect tz implementation but
for some reason std::list, std::set and std::map do not work at all,
and implementation B where the template library works perfectly but
the time zone version always returns "unknown", guess which one will
win. I can't see how there can be market pressure for implementation B
to improve its tz portion; it's not as if prospective customers will
go over to implementation A just because their tz portion works
perfectly, if there are glaring problems in other portions.

Philip Newton <philip.newton at gmail.com>

More information about the tz mailing list