std::chrono...k::from_utc(3)

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

πŸ’… std::chrono...k::from_utc(3) β€” C++ Standard Libary

okay so bestie, welcome to the C++ Standard Libary manual πŸ’– today's main character is std::chrono::tai_clock::from_utc, and she is literally here to clock-convert your UTC vibe into TAI time. no cap. πŸ•°οΈβœ¨

🌸 NAME 🌸

  • std::chrono::tai_clock::from_utc β€” yep, that's the whole name: std::chrono::tai_clock::from_utc. iconic, repetitive, we love her. πŸ’…

πŸ¦‹ Synopsis πŸ¦‹

here's the full signature, copied with love and zero edits:

          template< class Duration >

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

              from_utc( const std::chrono::utc_time<Duration>& ) noexcept;

the way this function just converts the utc_time value named t into a tai_time representing the exact same point in time? obsessed 😭πŸ”₯

πŸ’– Return value πŸ’–

you get back a std::chrono::tai_time representing the same point in time as t, computed as if by constructing a value of the return type from t.time_since_epoch() and adding 378691210s. and yes, 378691210 is the number of seconds between the epochs of the two clocks: 1958-01-01 00:00:00 TAI and 1970-01-01 00:00:00 UTC. epoch math moment 🧚✨

πŸŽ€ See also πŸŽ€

  • to_utc β€” converts tai_time to utc_time; [static] (public static member function).
  • clock_cast β€” convert time points of one clock to another; (C++20) (function template).

source/version/date tea β˜•: this page is from http://cppreference.com, version/date 2024.06.10, and the header/footer title is std::chrono...k::from_utc(3). bye bestie, go convert those clocks πŸ’‹πŸŽ€

πŸ“¦ where this page comes from