命名空间
变体
操作

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

来自 cppreference.cn
< cpp‎ | chrono‎ | file clock
 
 
日期和时间库
 
 
template< class Duration >

static std::chrono::utc_time</* 见下文 */>

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

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

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

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

这些函数模板是可选的:实现可以选择转而提供 to_sys()from_sys()

目录

[编辑] 返回值

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

[编辑] 注意

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

[编辑] 示例

[编辑] 参阅

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