CppDS.com

C++ 98 11 14 17 20 手册

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

来自cppreference.com
< cpp‎ | chrono‎ | file clock
 
 
日期和时间工具
(C++11)
(C++11)
当天时刻
(C++20)



(C++20)(C++20)(C++20)(C++20)
时钟
(C++20)
                                             
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
日历
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
时区
(C++20)
(C++20)
(C++20)
(C++20)
C 风格日期和时间
 
std::chrono::file_clock
成员函数

file_clock::to_sysfile_clock::from_sys
(仅若不提供 to_utcfrom_utc 才提供)

(仅若不提供 to_sysfrom_sys 才提供)
时间点 I/O
 
template <class Duration>

static std::chrono::sys_time</*see below*/>

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

static std::chrono::file_time</*see below*/>

    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 以未指定方式计算返回类型的时长。

这些函数模板是可选的:实现可以替而选择提供 to_utcfrom_utc

返回值

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

注意

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

参阅

[静态] (可选)
file_timeutc_time 之间转换
(公开静态成员函数)
转换一个时钟的时间点为另一个
(函数模板)
关闭