std::chrono...k::from_sys(3)
π¦ NAME π¦
Okay bestie, welcome to the std::chrono...k::from_sys(3) page from the C++ Standard Libary manual. The name is literally:
std::chrono::utc_clock::from_sysβstd::chrono::utc_clock::from_sys
β¨ Synopsis β¨
Hereβs the signature, exactly as itβs written on the page:
template< class Duration >
static std::chrono::utc_time<std::common_type_t<Duration,
(since C++20)
std::chrono::seconds>>
from_sys( const std::chrono::sys_time<Duration>& t );
So this static member function converts a sys_time named t to a utc_time named u that represents the same point in time. The equality that matters is:
u.time_since_epoch() - t.time_since_epoch() is equal to the number of leap seconds that was inserted between t and 1 January 1970. And if t is the exact date of a leap second insertion, that leap second is counted as inserted. Not me knowing leap-second lore, the page said it π
π Return value π
A utc_time representing the same point in time as t.
π See also π
to_sysβ convertsutc_timetosys_time;[static](public static member function)clock_castβ convert time points of one clock to another;(C++20)(function template)
Source/version/date sign-off: http://cppreference.com, 2024.06.10, and the manual page is std::chrono...k::from_sys(3). Mwah πβ¨
π¦ 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