std::chrono...ock::to_sys(3)

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

✨ NAME ✨

std::chrono::utc_clock::to_sys β€” literally std::chrono::utc_clock::to_sys, that's the whole name, no cap. We're in the C++ Standard Libary manual, bestie, and this page is the main character πŸ’…

🌸 Synopsis 🌸

          template< class Duration >

          static std::chrono::sys_time<std::common_type_t<Duration,
       (since C++20)
          std::chrono::seconds>>

              to_sys( const std::chrono::utc_time<Duration>& t );

Okay so to_sys converts a utc_time t to a sys_time representing the same point in time β€” if possible πŸ‘€. It's giving "same exact moment, different clock system."

Now the leap-second plot twist: if t represents a time point during a leap second insertion, the last representable value of sys_time prior to the insertion of the leap second is returned. In all other cases, utc_clock::from_sys(utc_clock::to_sys(t)) == t. periodt ✨

πŸ’– Return value πŸ’–

A sys_time representing the same point in time as t β€” or, if t represents a time point during a leap second insertion, the last representable value prior to the insertion of the leap second. That's the whole return vibe, no cap 🫢

πŸ¦‹ See also πŸ¦‹

  • from_sys β€” converts sys_time to utc_time; it's [static] (public static member function).
  • clock_cast β€” converts time points of one clock to another; (C++20) (function template).

that's the tea from http://cppreference.com, version/date 2024.06.10, page label std::chrono...ock::to_sys(3). bye bestie, go convert some clocks πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from