Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _time_zone gives me candidates other than timezones



At 16:22 -0700 29 Mar 2022, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Thu, Mar 24, 2022 at 12:28 PM Jordan Russell
<jordan.likes.curry@xxxxxxxxx> wrote:

I would like _time_zone to exclude these filenames that are not
timezones [...]

If I modify it to just exclude those files that begin with a lowercase
letter then it gives me only proper timezone names.

That excludes the directories "posix" and "right" on my system (I have
no idea what the latter one means).

Quoting from https://www.ucolick.org/~sla/leapsecs/right+gps.html:

The "right" files in the tz (zoneinfo) database have a subtle difference from the POSIX standard. POSIX requires that the system clock value of time_t represent the number of non-leap seconds since 1970-01-01. This is the same as requiring POSIX seconds to be mean solar seconds of UT, not the atomic seconds that UTC has counted since 1972-01-01.

The "right" zoneinfo files assert that the system clock value of time_t represent the actual number of seconds in the internationally approved broadcast time scale since 1970-01-01. As a result the value of time_t which is expected by the "right" zoneinfo files is greater than the value of time_t specified by POSIX. The difference in the values of time_t is the number of leap seconds which have been inserted into the internationally approved broadcast time scale. As of year 2011 the difference is 24 seconds. I'm a bit more puzzled about why the separate `posix` directory exists. At least for my local time zone it doesn't seem to matter if I use that or leave it out; while using the `right` one definitely makes a difference:

date; TZ=right/America/New_York date; TZ=posix/America/New_York date
2022-03-29T20:07:47 EDT
2022-03-29T20:07:20 EDT
2022-03-29T20:07:47 EDT

Is everyone OK with that?

While I don't think I've ever really needed to use zoneinfo entries from those directories, I'd certainly prefer they be offered for completion.




Messages sorted by: Reverse Date, Date, Thread, Author