std::chrono::tzdb_list& get_tzdb_list(); | (1) | (since C++20) |
const std::chrono::tzdb& get_tzdb(); | (2) | (since C++20) |
std::string remote_version(); | (3) | (since C++20) |
const std::chrono::tzdb& reload_tzdb(); | (4) | (since C++20) |
These functions provide access to the program-wide time zone database.
std::chrono::tzdb_list
singleton. If this is the first access to the database, initialize the database. After the initialization, the database will hold a single initialized std::chrono::tzdb
object. This function is thread-safe: concurrent calls to this function from multiple threads do not introduce a data race.std::chrono::tzdb
object held by the tzdb_list
singleton. Equivalent to std::chrono::get_tzdb_list().front()
.remote_version() != get_tzdb().version
, pushes a new tzdb
object representing the remote database to the front of the tzdb_list
singleton referenced by get_tzdb_list()
. Otherwise there are no effects. No references, pointers or iterators are invalidated. Calling this function concurrently with get_tzdb_list().front()
or get_tzdb_list().erase_after()
does not introduce a data race.std::runtime_error
if for any reason a reference to a tzdb_list
containing one or more valid tzdb
cannot be returned.std::chrono::tzdb_list
singleton.std::chrono::get_tzdb_list().front()
.std::chrono::get_tzdb_list().front()
(after any update made by this function).
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/chrono/tzdb_functions