std::chrono::locate_zone(3)

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

πŸ’– std::chrono::locate_zone πŸ’–

okay so bestie, this page lives in the C++ Standard Libary manual (yes, spelled exactly like that on the tin), and the page is literally std::chrono::locate_zone. It’s giving very β€œname equals name” energy and honestly? Iconic. πŸ’…

πŸ’– NAME πŸ’–

std::chrono::locate_zone β€” std::chrono::locate_zone. That’s the whole name entry, no cap. πŸŽ€

🌸 Synopsis 🌸

Defined in header <chrono>, and it’s (since C++20) β€” here’s the signature, verbatim:

Defined in header <chrono>
const std::chrono::time_zone* locate_zone( std::string_view tz_name
(since C++20)
);

It’s a convenience function for locating a time zone in the time zone database, and it’s equivalent to exactly this:

std::chrono::get_tzdb().locate_zone(tz_name)

πŸ¦‹ Exceptions πŸ¦‹

It’s std::runtime_error if:

  • the specified time zone cannot be found, or
  • this is the first reference to the time zone database and the time zone database cannot be initialized.

✨ Notes ✨

A call to this function that is the first reference to the time zone database will cause it to be initialized. That’s the whole note, bestie β€” it initializes the database on first reference. 🫢

πŸŽ€ See also πŸŽ€

  • locate_zone β€” locate a time zone with the given name (public member function of std::chrono::tzdb)
  • get_tzdb
  • get_tzdb_list β€” accesses and controls the global time zone database information
  • reload_tzdb β€” (function)
  • remote_version β€” (C++20)

mwah πŸ’‹ tysm for reading, bestie! This page comes from http://cppreference.com, dated 2024.06.10, and it’s the std::chrono::locate_zone(3) page. πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from