Namespaces
Variants
Views
Actions

std::chrono::get_tzdb_list, std::chrono::get_tzdb, std::chrono::remote_version, std::chrono::reload_tzdb

From cppreference.com
< cpp‎ | chrono
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
Date and time utilities
Time point
(C++11)
(C++20)
Duration
(C++11)
Clocks
(C++11)      
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time of day
(C++20)(C++20)
(C++20)(C++20)
(C++20)

Calendars
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
Time zones
(C++20)
(C++20)
get_tzdbget_tzdb_listreload_tzdbremote_version
(C++20)(C++20)(C++20)(C++20)
(C++20)
chrono I/O
(C++20)
C-style date and time
 
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.

1) 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.
2) Returns a reference to the first std::chrono::tzdb object held by the tzdb_list singleton. Equivalent to std::chrono::get_tzdb_list().front().
3) Returns a string containing the latest remote database version.
4) If 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.

[edit] Exceptions

1) std::runtime_error if for any reason a reference to a tzdb_list containing one or more valid tzdb cannot be returned.

[edit] Return value

1) A reference to the global std::chrono::tzdb_list singleton.
2) std::chrono::get_tzdb_list().front().
3) A string containing the latest remote database version.
4) std::chrono::get_tzdb_list().front() (after any update made by this function).