date::make_zoned() crashes in Windows

57 Views Asked by At

I am developing a cross-platform application for which I am using date.h library using Visual Studio 2022 under Windows and GCC 11 under Linux. I know that Visual Studio C++20 has the date library integrated itself but unfortunately, I cannot use it and have to use date.h library for my application.

The library is imported using cmake date::date date::date-tz.

The following code snippet works correctly in Linux but it crashes with the error Microsoft Visual C++ Runtime Library with the message abort() has been called when it calls date::make_zoned in Windows.

using namespace std::chrono;
auto utc = time_point_cast<microseconds>(system_clock::now());
auto chicago = date::make_zoned("America/Chicago", utc);
auto local = date::make_zoned(date::current_zone(), utc);

Could someone kindly help me out?

0

There are 0 best solutions below