Home > Net >  std::zoned_time on Windows Server not working
std::zoned_time on Windows Server not working

Time:10-20

I've encountered a weird problem with std::chrono::zoned_time{}. Even oddly it works on my machine not the remote sever I'm building this app for.

This simple code - witch I found there Microsoft Learn

#include <iostream>
#include <chrono>

using namespace std::chrono;

int main()
{
    zoned_time zt("Antarctica/Casey", sys_days{2021y/September/15d} 16h 45min);
    sys_info si = zt.get_info();
    std::cout << si;

    return 0;
}

which writes on development machine

begin: 2020-10-03 16:01:00, end: 32767-12-31 23:59:59, offset: 39600s, save: 0min, abbrev: GMT 11

just dies on the deployment server.

I really don't get what's being wrong here.

Development machine is Windows 10 Pro, version 21H2, build 19044.2130 Deployment server is Windows Server 2016 version 1809, build 17763.3532

CodePudding user response:

I do not know, but I suspect that your deployment server does not ship with the ICU library that is required for this part of C 20 to work on Windows platforms.

From here:

While our current implementation relies on the availability of the ICU DLL in more recent OS versions, we have plans to revisit the issue and investigate implementing a fallback for older operating systems.

  • Related