[tz] Getting current tzdb version in use

Paul Eggert eggert at cs.ucla.edu
Fri Jul 20 18:45:48 UTC 2018

Paul G wrote:
> I want to write a test that says, "Europe/Dublin should return negative DST in the winter", but that test only works with versions >= 2018e. There's no really good heuristic for that - if it doesn't return negative DST it's either that my version is too old or my implementation is wrong. Having a version number really helps distinguish between these two.

That test should also work for versions 2018a and 2018b. If you're running that 
test only for versions 2018e or later it won't matter that it also works in some 
earlier versions. But if you expect the test to work one way in 2018e-or-later 
and the other way in 2018d-or-earlier, you'll find that this expectation is not 
true for 2018a and 2018b.

This underscores the point that it's typically better to test for the feature 
you care about, instead of trying to infer features from version strings.

More information about the tz mailing list