88 lines
2.7 KiB
Markdown
88 lines
2.7 KiB
Markdown
[time.zone.db.remote]
|
||
|
||
# 30 Time library [[time]](./#time)
|
||
|
||
## 30.11 Time zones [[time.zone]](time.zone#db.remote)
|
||
|
||
### 30.11.2 Time zone database [[time.zone.db]](time.zone.db#remote)
|
||
|
||
#### 30.11.2.4 Remote time zone database support [time.zone.db.remote]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9018)
|
||
|
||
The local time zone database
|
||
is that supplied by the implementation
|
||
when the program first accesses the database,
|
||
for example via current_zone()[.](#1.sentence-1)
|
||
|
||
While the program is running,
|
||
the implementation may choose to update the time zone database[.](#1.sentence-2)
|
||
|
||
This update shall not impact the program in any way
|
||
unless the program calls the functions in this subclause[.](#1.sentence-3)
|
||
|
||
This potentially updated time zone database
|
||
is referred to as the [*remote time zone database*](#def:remote_time_zone_database "30.11.2.4 Remote time zone database support [time.zone.db.remote]")[.](#1.sentence-4)
|
||
|
||
[ð](#lib:reload_tzdb)
|
||
|
||
`const tzdb& reload_tzdb();
|
||
`
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9036)
|
||
|
||
*Effects*: This function first checks
|
||
the version of the remote time zone database[.](#2.sentence-1)
|
||
|
||
If the versions of the local and remote databases are the same,
|
||
there are no effects[.](#2.sentence-2)
|
||
|
||
Otherwise the remote database is pushed
|
||
to the front of the tzdb_list accessed by get_tzdb_list()[.](#2.sentence-3)
|
||
|
||
[3](#3)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9046)
|
||
|
||
*Synchronization*: This function is thread-safe with respect toget_tzdb_list().front() and get_tzdb_list().erase_after()[.](#3.sentence-1)
|
||
|
||
[4](#4)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9051)
|
||
|
||
*Postconditions*: No pointers, references, or iterators are invalidated[.](#4.sentence-1)
|
||
|
||
[5](#5)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9055)
|
||
|
||
*Returns*: get_tzdb_list().front()[.](#5.sentence-1)
|
||
|
||
[6](#6)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9059)
|
||
|
||
*Throws*: runtime_error if for any reason
|
||
a reference cannot be returned to a valid tzdb[.](#6.sentence-1)
|
||
|
||
[ð](#lib:remote_version)
|
||
|
||
`string remote_version();
|
||
`
|
||
|
||
[7](#7)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9071)
|
||
|
||
*Returns*: The latest remote database version[.](#7.sentence-1)
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
This can be compared with get_tzdb().version to discover if the local and remote databases are equivalent[.](#7.sentence-2)
|
||
|
||
â *end note*]
|