命名空间
变体
操作

std::chrono::file_clock::to_sys, std::chrono::file_clock::from_sys

来自 cppreference.cn
< cpp‎ | chrono‎ | file clock
 
 
 
 
template< class Duration >

static std::chrono::sys_time</*参见下文*/>

    to_sys( const std::chrono::file_time<Duration>& t );
(1) (自 C++20 起)
(可选*)
template< class Duration >

static std::chrono::file_time</*参见下文*/>

    from_sys( const std::chrono::sys_time<Duration>& t );
(2) (自 C++20 起)
(可选*)
1)file_time t 转换为表示相同时间点的 sys_time
2)sys_time t 转换为表示相同时间点的 file_time

返回类型的 duration 从 Duration 以未指定的方式计算。

这些函数模板是可选的:实现可以选择提供 to_utc()from_utc() 来代替。

目录

[edit] 返回值

1) 一个 sys_time,表示与参数相同的时间点。
2) 一个 file_time,表示与参数相同的时间点。

[edit] 注解

用户代码通常应使用 std::chrono::clock_cast,它提供了一个通用的接口来转换时钟之间的时间点,而不是直接调用这些函数。

[edit] 示例

[edit] 参见

[静态] (可选)
file_timeutc_time 之间转换
(公共静态成员函数) [编辑]
转换一个时钟的时间点到另一个时钟
(函数模板) [编辑]