Namespaces
Variants

std::chrono::tzdb:: locate_zone

From cppreference.net
std::chrono::tzdb
Member functions
tzdb::locate_zone
const std:: chrono :: time_zone * locate_zone ( std:: string_view tz_name ) const ;
(C++20 起)

获取此数据库中表示由 tz_name 指定时区的 std::chrono::time_zone 指针。若 p 为返回的指针,则满足 p - > name ( ) == tz_name ,或存在此数据库中的 std::chrono::time_zone_link l 使得 p - > name ( ) == l. target ( ) && l. name ( ) == tz_name

目录

参数

tz_name - 时区名称

返回值

指向此数据库中表示由 tz_name 指定时区的 std::chrono::time_zone 的指针。

异常

若无法找到对应的 time_zone ,则抛出 std::runtime_error

示例