std::chrono::time_zone(3)
π std::chrono::time_zone π
okay bestie, welcome to the std::chrono::time_zone(3) page from the C++ Standard Libary manual. This is the C++ time zone class and it's honestly a little iconic. π
π« NAME π«
std::chrono::time_zone β std::chrono::time_zone. That's the name, no cap. π«Ά
β¨ Synopsis β¨
Defined in header <chrono>:
class time_zone; (since C++20)
So time_zone is the class for all time zone transitions in one specific geographic area. Yes, all the transitions. It's giving geographic time zone main character energy. ππ
Users cannot construct time_zone objects. Nope, not you, not your friend, not even your very smartest template. The library implementation is the one creating time_zone objects β it does that when it initializes the time zone database β and it provides const access to these objects. So the library does the crafting, and you get to look respectfully. πβ¨
time_zone is not copyable but does have a defaulted move constructor and a defaulted move assignment operator. Cute! But here's the plot twist: as users have only const access to time_zone objects, these functions cannot be called in user code without invoking undefined behavior.
β οΈ Undefined behavior alert: those move functions exist, but user code cannot call them without invoking undefined behavior. So do not test the universe on this one, bestie. Periodt. π«π
πΈ Member functions πΈ
nameβ obtains the name of thistime_zone(public member function). π·οΈget_infoβ obtains information associated with asys_timeorlocal_time(public member function). πto_sysβ converts alocal_timein this time zone to asys_time(public member function). β°β‘οΈπto_localβ converts asys_timeto alocal_timein this time zone (public member function). πβ‘οΈβ°
π¦ Nonmember functions π¦
operator==β compares twotime_zoneobjects. π«Άoperator<=>β(function),(C++20). β¨
That's the whole page, bestie! Source: http://cppreference.com. Version/date: 2024.06.10. Page: std::chrono::time_zone(3). Now go forth and let the library handle the time zone database, because that's its job and it ate. π
ππ¦
π¦ 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