std::chrono::file_clock
来自cppreference.com
日期和时间工具
时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C 风格日期和时间 |
std::chrono::file_clock
成员函数 | ||||
|
||||
(仅若不提供
to_utc
和
from_utc
才提供)
|
||||
|
||||
(仅若不提供
to_sys
和
from_sys
才提供)
|
||||
时间点 I/O | ||||
在标头
<chrono>
定义
|
||
using
file_clock =
/* see
below */;
|
(C++20 起) | |
std::chrono::file_clock
是用于 std::filesystem::file_time_type
的时钟的别名。不指定其纪元。
时间点族
定义于命名空间
std::chrono |
||
template<class
Duration>
using file_time = std::chrono::time_point<std::chrono::file_clock, Duration>; |
(C++20 起) | |
进行 file_time 上的流输出 (函数模板) |
|
按照给定的格式从流分析 file_time (函数模板) |
|
std::formatter 的特化,按照提供的格式格式化
file_time (类模板特化) |
成员类型
成员类型 | 定义 |
rep
|
表示时钟时长中计次数的有符号算术类型 |
period
|
表示时钟计次周期的 std::ratio 类型,单位为秒 |
duration
|
std::chrono::duration<rep, period> ,足以表示负时长 |
time_point
|
std::chrono::time_point<std::chrono::file_clock> |
成员常量
constexpr
bool
is_steady
[静态]
|
若时间间隔计次始终为常数,即纵使在调整了外部时钟的情况下,调用 now()
的返回值亦单调递增,则为 true
;否则为 false
(公开静态成员常量) |
成员函数
file_clock
提供下列二对静态成员函数中的一对:
-
to_utc
与from_utc
;或 -
to_sys
与from_sys
。
[静态]
|
返回表示当前时间点的 std::chrono::time_point
(公开静态成员函数) |
[静态]
(可选)
|
在 file_time 与 utc_time 之间转换 (公开静态成员函数) |
[静态]
(可选)
|
在 file_time 与 sys_time 之间转换 (公开静态成员函数) |