HowardHinnant / date

A date and time library based on the C++11/14/17 <chrono> header
Other
3.08k stars 670 forks source link

Extracting current timezone fails on SLES #708

Closed JaroslawMelzer closed 2 years ago

JaroslawMelzer commented 2 years ago

Running date library on SLES 11.4 I've encountered a following issue. Call to current_zone() returns "TIMErica/Chicago". I've debugged why and it turns out that zone extraction falls back to the code parsing /etc/sysconfig/clock file. But instead of ZONE="America/Chicago" there is TIMEZONE="America/Chicago". I'm attaching patch that should fix the issue and /etc/sysconfig/clock file for reproduction.

clock.txt sysconfig.clock.diff.txt

HowardHinnant commented 2 years ago

Very elegant fix, thanks!

I'm happy to push that patch. Or would you like to do it with a PR?

JaroslawMelzer commented 2 years ago

Go ahead an push the patch. Happy to help!