Closed hvenev closed 3 months ago
Thanks for reporting but {fmt} is a C++ library and doesn't have to replicate legacy C behaviors. If you believe there is something wrong with std::chrono::current_zone
please open an LWG issue.
The problem is that the other fmt::localtime uses the "legacy" C behavior specified by POSIX.
It's just a fallback. We could make it more consistent with std::chrono::current_zone
but it's not critical.
I had misunderstood the code. Sorry for wasting your time.
fmt::localtime uses
std::chrono::current_zone()
to determine the local time zone. However, per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114645, the intended behavior ofstd::chrono::current_zone()
is to read/etc/localtime
, which does not match how libc determines the local time zone. TheTZ
environment variable should also be considered.