std::chrono::utc_clock::from_sys
来自 cppreference.cn
template< class Duration > static std::chrono::utc_time<std::common_type_t<Duration, std::chrono::seconds>> |
(自 C++20 起) | |
将 sys_time
t 转换为 utc_time
u
,后者表示时间上的同一点。
u.time_since_epoch() - t.time_since_epoch() 等于在 t 和 1970 年 1 月 1 日之间插入的闰秒数。如果 t 是闰秒插入的确切日期,则该闰秒被计为已插入。
[编辑] 返回值
表示与 t 时间上同一点的 utc_time
。
[编辑] 参见
[静态] |
将 utc_time 转换为 sys_time (公共静态成员函数) |
(C++20) |
将一个时钟的时间点转换为另一个时钟的时间点 (函数模板) |