https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114645

--- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Harald van Dijk from comment #14)
> (In reply to Jonathan Wakely from comment #8)
> > None of libstdc++, LLVM libc++, MSVC STL or the
> > date/tz.h reference implementation uses $TZ for chrono::current_zone,
> 
> This does not appear to be accurate.
> 
> libc++ appears to always uses $TZ on POSIX-like platforms if it is set:
> https://github.com/llvm/llvm-project/blob/
> 788be0d9fc6aeca548c90bac5ebe6990dd3c66ec/libcxx/src/tzdb.cpp#L708

... incorrectly though?

I would expect TZ=:Europe/London to work according to POSIX, but it seems they
don't remove the ':' before the lookup. So it only works for a string like
"MST7MDT" which means only the following entries in the IANA database can be
matched by a value in $TZ:

Z CET 1 c CE%sT
Z CST6CDT -6 u C%sT
Z EET 2 E EE%sT
Z EST -5 - EST
Z EST5EDT -5 u E%sT
Z Factory 0 - -00
Z HST -10 - HST
Z MET 1 c ME%sT
Z MST -7 - MST
Z MST7MDT -7 u M%sT
Z PST8PDT -8 u P%sT
Z WET 0 E WE%sT

That doesn't seem very well thought out or tested.

Reply via email to