std::chrono::get_tzdb_list, std::chrono::get_tzdb, std::chrono::remote_version, std::chrono::reload_tzdb - cppreference.com (original) (raw)
| 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.
Returns a reference to the global 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.
Returns a reference to the first std::chrono::tzdb object held by the
tzdb_listsingleton. Equivalent to std::chrono::get_tzdb_list().front().Returns a string containing the latest remote database version.
If remote_version() != get_tzdb().version, pushes a new
tzdbobject representing the remote database to the front of thetzdb_listsingleton referenced byget_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.
[edit] Exceptions
- std::runtime_error if for any reason a reference to a
tzdb_listcontaining one or more validtzdbcannot be returned.
[edit] Return value
A reference to the global std::chrono::tzdb_list singleton.
std::chrono::get_tzdb_list().front().
A string containing the latest remote database version.
std::chrono::get_tzdb_list().front() (after any update made by this function).