std::chrono::year_month_weekday::operator sys_days, std::chrono::year_month_weekday::operator local_days
来自cppreference.com
< cpp | chrono | year month
weekday
工具库
日期和时间工具
时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C 风格日期和时间 |
std::chrono::year_month_weekday
成员函数 | ||||
year_month_weekday::operator
sys_daysyear_month_weekday::operator
local_days
|
||||
非成员函数 | ||||
辅助类 | ||||
constexpr
operator std::chrono::sys_days()
const
noexcept;
|
(1) | (C++20 起) |
explicit
constexpr
operator std::chrono::local_days()
const
noexcept;
|
(2) | (C++20 起) |
转换 *this
为与此 year_month_weekday
表示同一日期的 std::chrono::time_point
。
1) 若 year().ok()
&& month().ok()
&& weekday().ok() :
-
- 若 index()
==
0
,则返回表示该年月的首个 weekday() 前
7 日的日期的
sys_days
。 - 其他情况下,返回表示该年月的首个 weekday() 后
(index()
-
1)
*
7
日的日期的
sys_days
。
- 若 index()
==
0
,则返回表示该年月的首个 weekday() 前
7 日的日期的
否则,返回值未指定。
2) 同 (1)
,但返回
local_days
,而非 sys_days
。等价于 local_days(sys_days(*this).time_since_epoch()) 。