std::chrono...locate_zone(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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