std::chrono::year_month_day_last::operator sys_days, std::chrono::year_month_day_last::operator local_days
来自cppreference.com
< cpp | chrono | year month day
last
工具库
日期和时间工具
| 时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C 风格日期和时间 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::year_month_day_last
| 成员函数 | ||||
|
year_month_day_last::operator
sys_daysyear_month_day_last::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_day_last 表示相同日期的 std::chrono::time_point
。这等价于从 year() 、 month() 和 day()
合成 year_month_day ,再将该 year_month_day 转换成目标类型。
1) 等价于 std::chrono::sys_days(year()/month()/day())
2) 等价于 std::chrono::local_days(year()/month()/day())
示例
| 本节未完成 原因:暂无示例 |
参阅
| 转换到 std::chrono::time_point
( std::chrono::year_month_day
的公开成员函数) |