Does GCC or Clang implement chrono::current_zone()?
Asked Answered
S

2

7

Cppreference mentions function current_zone() as part of the timezone implementation in <chrono>. Has this feature been implemented in GCC or Clang? I would like to test it in one of the online tools, such as https://wandbox.org or https://godbolt.org/, but it seems to be missing.

Spiegeleisen answered 25/1, 2022 at 17:14 Comment(0)
A
5

Compiler support for C++20 - cppreference.com

C++20 feature Paper(s) GCC libstdc++ Clang libc++ MSVC STL Apple Clang
Calendar and timezone P0355R7 11 (partial) 7 (partial) 19.29 (16.10)* 10.0.0*

So there is some support, but basically you have to check compilers documentation to se in details what is already implemented, or just try and see. For now using example from docks compiles only for msvc.

Note this feature is based on Howard Hinnant's date library which you can use with older version of C++ standard.

Asthenia answered 25/1, 2022 at 18:10 Comment(1)
There's also Howard Hinnant's date library. I thought that's what the proposal is based on.Launcher
G
3

There are no results in https://github.com/llvm/llvm-project/search?q=current_zone (except clangd indexer) and in https://github.com/gcc-mirror/gcc/search?q=current_zone (except for disabled chrono C++20 conformance test stuff).

Does GCC or Clang implement chrono::current_zone()?

No, not currently.

Gilletta answered 25/1, 2022 at 21:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.