std::chrono::file_clock::to_utc, std::chrono::file_clock::from_utc

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

staticstd::chrono::utc_time</* 见下文 */>

    to_utc(conststd::chrono::file_time<Duration>& t );
(1) (C++20 起)
(optional*)
template<class Duration >

staticstd::chrono::file_time</* 见下文 */>

    from_utc(conststd::chrono::utc_time<Duration>& t );
(2) (C++20 起)
(optional*)
1) 转换 file_timet 为表示同一时间点的 utc_time
2) 转换 utc_timet 为表示同一时间点的 file_time

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

这些函数模板是可选的:实现可以自行决定提供 to_sys()from_sys()

目录

[编辑] 返回值

1) 与实参表示相同时间点的 utc_time
2) 与实参表示相同时间点的 file_time

[编辑] 注解

用户代码通常应使用 std::chrono::clock_cast,它对时钟间转换提供通用接口,而非直接调用这些函数。

[编辑]示例

[编辑] 参阅

[静态](可选)
file_timesys_time 之间转换
(公开静态成员函数)[编辑]
(C++20)
转换一个时钟的时间点为另一个
(函数模板)[编辑]
close