std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator (3) - Linux Manuals
std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator: std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator
NAME
std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator - std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator
Synopsis
constexpr operator std::chrono::sys_days()
explicit constexpr operator std::chrono::local_days()
noexcept;
Converts
year_month_day.
1)
std::chrono::system_clock epoch
*this represent a date prior to it.
Otherwise, if the stored year and month are valid
true), then the returned value is sys_days(year()/month()/1d)
Otherwise
unspecified.
A sys_days in the range
when converted to year_month_day and back, yields the same value.
2)
local_days(sys_days(*this).time_since_epoch());.
Notes
Converting to sys_days and back can be used to normalize a year_month_day that
contains an invalid day but a valid year and month:
Normalizing the year and month can be done by adding
std::chrono::months:
Example