[time.zone.db.access]

# 30 Time library [[time]](./#time)

## 30.11 Time zones [[time.zone]](time.zone#db.access)

### 30.11.2 Time zone database [[time.zone.db]](time.zone.db#access)

#### 30.11.2.3 Time zone database access [time.zone.db.access]

[ð](#lib:get_tzdb_list)

`tzdb_list& get_tzdb_list();
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8954)

*Effects*: If this is the first access to the time zone database,
initializes the database[.](#1.sentence-1)

If this call initializes the database,
the resulting database will be a tzdb_list holding a single initialized tzdb[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8962)

*Synchronization*: It is safe to call this function from multiple threads at one time[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8966)

*Returns*: A reference to the database[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8970)

*Throws*: runtime_error if for any reason
a reference cannot be returned to a valid tzdb_list containing one or more valid tzdbs[.](#4.sentence-1)

[ð](#lib:get_tzdb)

`const tzdb& get_tzdb();
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8983)

*Returns*: get_tzdb_list().front()[.](#5.sentence-1)

[ð](#lib:locate_zone)

`const time_zone* locate_zone(string_view tz_name);
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8994)

*Returns*: get_tzdb().locate_zone(tz_name)[.](#6.sentence-1)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8998)

[*Note [1](#note-1)*:

The time zone database will be initialized
if this is the first reference to the database[.](#7.sentence-1)

â *end note*]

[ð](#lib:current_zone)

`const time_zone* current_zone();
`

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9011)

*Returns*: get_tzdb().current_zone()[.](#8.sentence-1)
