On Linux, I need to find the currently configured timezone as an Olson location. I want my (C or C++) code to be portable to as many Linux systems as possible.
For e
I've been working on a free, open source C++11/14 library which addresses this question in a single line of code:
std::cout << date::current_zone()->name() << '\n';
It is meant to be portable across all recent flavors of Linux, macOS and Windows. For me this program outputs:
America/New_York
If you download this library, and it doesn't work you, bug reports are welcome.