命名空间
变体
操作

std::chrono::utc_clock::from_sys

来自 cppreference.cn
< 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 是闰秒插入的精确日期,则该闰秒被计算为已插入。

[编辑] 返回值

一个 `utc_time`,表示与 t 相同的时间点。

[编辑] 参阅

[静态]
将 `utc_time` 转换为 `sys_time`
(public static member function) [编辑]
将一个时钟的时间点转换为另一个时钟的时间点
(function template) [编辑]