Previously I used Howard Hinnant's "date.h" header library but I recently switched to C++20's std::chrono (which is basically an implementation of Howard's cool library) but I cannot get the timezone abbreviations to print in a normal way (e.g. EST for New York time). All I get is GMT-4 (currently we are in daylight savings time).
I am using MSVC with Visual Studio 2022 PRE and I read that Microsoft are not using the full IANA database but something called ICU that is already downloaded by Windows. Could this be the cause of the missing abbreviations?
Here is the code I am using:
auto tm = std::chrono::system_clock::now();
std::cout << std::format("{:%X %Z}", std::chrono::zoned_time("America/New_York", tm));
For me at 22:55:52 in Singapore it prints 10:55:52 GMT-4 rather than 10:55:52 EST which is what I want.
Does anyone know how to resolve this on Microsoft Visual Studio using standard C++20?