Guy Harris <gharris@sonic.net> writes:
On Oct 7, 2021, at 10:00 AM, Tom Lane via tz <tz@iana.org> wrote:
I'm envisioning that there could be a text file at the top level, say /usr/share/zoneinfo/version in typical layouts, containing "2021a" or the appropriate string. This'd make it a lot easier to diagnose what you've got in a particular installation.
$ cat /usr/share/zoneinfo/+VERSION 2021a
Interesting ... and in fact, Apple's labeling it in another way too, because I see this on my Mac laptop: $ ls -l /usr/share/zoneinfo/ lrwxr-xr-x 1 root wheel 38 Sep 13 19:15 /usr/share/zoneinfo/ -> /var/db/timezone/tz/2021a.1.0/zoneinfo But that pretty much just begs the point, which is that there's no *standard* cross-platform way to get this info. On my RHEL workstation, I don't see any identification info except the first line of tzdata.zi, which isn't a standard inclusion either. (Of course, I can consult the RPM package database to find out the version of the tzdata package ... still more platform dependency.) My point isn't whether it's possible to figure this out on any given platform, but that tzdata itself ought to define a standard way to find it out. And I do not agree with Paul's opinion that "include tzdata.zi" is a good enough answer; lots of platforms won't care to expend the disk space to do it that way. (But, in view of Apple having already done it like that, maybe there's something to be said for using +VERSION as the file name.) regards, tom lane