current_zone() and zoned time problem of cpp

I want to build a software that uses current_zone() on FreeBSD-CURRENT. The AI said that I need to switch on the experimental function and I did this test under the instruction of AI. And the AI also said there is a dzdata.zi, but I don`t know where it is or how to use it.
Code:
cat > /tmp/test.cpp <<'EOF'
#include <chrono>

int main()
{
    auto *tz = std::chrono::current_zone();
    std::chrono::zoned_time zt(tz, std::chrono::system_clock::now());
}
EOF

c++ -std=c++20 -fexperimental-library /tmp/test.cpp
/tmp/test.cpp:5:29: error: no member named 'current_zone' in namespace
      'std::chrono'
    5 |     auto *tz = std::chrono::current_zone();
      |                             ^~~~~~~~~~~~
/tmp/test.cpp:6:18: error: no member named 'zoned_time' in namespace 'std::chrono'
    6 |     std::chrono::zoned_time zt(tz, std::chrono::system_clock::now());
      |                  ^~~~~~~~~~
2 errors generated.
 
Last edited by a moderator:
Back
Top