std::chrono...locate_zone(3)
π NAME π
Bestie, this is from the C++ Standard Library manual, and the star of the show is std::chrono::tzdb::locate_zone β literally std::chrono::tzdb::locate_zone. Yes, that's the whole name, and yes, it's giving chrono energy. β¨
π¦ Synopsis π¦
const std::chrono::time_zone* locate_zone( std::string_view tz_name )
const;
(since C++20)
Okay so locate_zone obtains a pointer to a std::chrono::time_zone in this database that represents the time zone designated by tz_name. If p is the returned pointer, then either p->name() == tz_name, or there is a std::chrono::time_zone_link l in this database such that p->name() == l.target() && l.name() == tz_name. That's the rule, no cap.
π Return value π
A pointer to the std::chrono::time_zone in this database that represents the time zone designated by tz_name. Iconic pointer behavior, honestly.
π Exceptions π
Throws std::runtime_error if no such time_zone can be found. So if your zone is missing, it's not ghosting you silently β it's throwing std::runtime_error. π
π§ Example π§
This section is incomplete. Reason: no example.
πΈ Category πΈ
- Todo no example
π Source/version vibes: cppreference.com, dated 2024.06.10. Go locate your zone and slay, bestie β periodt. π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms