(C++11)
clock_time_conversion(C++20)
(C++20)
Duration duration(C++11)
Clocks system_clock(C++11)
steady_clock(C++11)
is_clock(C++20)
utc_clock(C++20)
tai_clock(C++20)
high_resolution_clock(C++11)
gps_clock(C++20)
file_clock(C++20)
local_t(C++20)
Time of day is_amis_pm(C++20)(C++20)
make12make24(C++20)(C++20)
hh_mm_ss(C++20)
Calendar day(C++20)
month(C++20)
year(C++20)
weekday(C++20)
operator/(C++20)
year_month_day(C++20)
year_month_day_last(C++20)
year_month_weekday(C++20)
year_month_weekday_last(C++20)
(C++20)
weekday_last(C++20)
month_day(C++20)
month_day_last(C++20)
month_weekday(C++20)
month_weekday_last(C++20)
year_month(C++20)
last_speclast(C++20)(C++20)
chrono
I/O parse
(C++20)
(C++20)
tzdb_list(C++20)
get_tzdbget_tzdb_listreload_tzdbremote_version(C++20)(C++20)(C++20)(C++20)
sys_info(C++20)
local_info(C++20)
nonexistent_local_time(C++20)
ambiguous_local_time(C++20)
locate_zone(C++20)
current_zone(C++20)
time_zone(C++20)
choose(C++20)
zoned_traits(C++20)
zoned_time(C++20)
time_zone_link(C++20)
leap_second(C++20)
leap_second_info(C++20)
get_leap_second_info(C++20)
C-style date and time [edit] std::chrono::year_month Member functions year_month::year_month year_month::yearyear_month::monthyear_month::operator+=year_month::operator-=
year_month::ok Nonmember functions operator==operator<=> operator+operator- operator<< from_stream Helper classes formatter<std::chrono::year_month> hash<std::chrono::year_month>(C++26)
[edit] constexpr std::chrono::year_month&Modifies the time point *this represents by the duration dy or dm.
1) Equivalent to *this = *this + dy;.
2) Equivalent to *this = *this + dm;.
3) Equivalent to *this = *this - dy;.
4) Equivalent to *this = *this - dm;.
For durations that are convertible to both std::chrono::years and std::chrono::months, the years
overloads (1,3) are preferred if the call would otherwise be ambiguous.
Run this code
#include <cassert> #include <chrono> int main() { auto ym{std::chrono::day(1)/7/2023}; ym -= std::chrono::years{2}; assert(ym.month() == std::chrono::July); assert(ym.year() == std::chrono::year(2021)); ym += std::chrono::months{7}; assert(ym.month() == std::chrono::month(2)); assert(ym.year() == std::chrono::year(2022)); }[edit] See also operator+operator-
(C++20)
performs arithmetic onyear_month
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4