std::chrono::utc_clock::from_sys

来自cppreference.com
< cpp‎ | chrono‎ | utc clock
 
 
 
 
template< class Duration >

static std::chrono::utc_time<std::common_type_t<Duration, std::chrono::seconds>>

    from_sys( const std::chrono::sys_time<Duration>& t );
(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_timesys_time
(公开静态成员函数)
转换一个时钟的时间点为另一个
(函数模板)