[time.cal.ymdlast.members]

# 30 Time library [[time]](./#time)

## 30.8 The civil calendar [[time.cal]](time.cal#ymdlast.members)

### 30.8.15 Class year_month_day_last [[time.cal.ymdlast]](time.cal.ymdlast#members)

#### 30.8.15.2 Member functions [time.cal.ymdlast.members]

[ð](#lib:year_month_day_last,constructor)

`constexpr year_month_day_last(const chrono::year& y,
                              const chrono::month_day_last& mdl) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6848)

*Effects*: Initializes y_ with y and mdl_ with mdl[.](#1.sentence-1)

[ð](#lib:operator+=,year_month_day_last)

`constexpr year_month_day_last& operator+=(const months& m) noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6859)

*Constraints*: If the argument supplied by the caller for the months parameter
is convertible to years,
its implicit conversion sequence to years is worse than its implicit conversion sequence tomonths ([[over.ics.rank]](over.ics.rank "12.2.4.3 Ranking implicit conversion sequences"))[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6867)

*Effects*: *this = *this + m[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6871)

*Returns*: *this[.](#4.sentence-1)

[ð](#lib:operator-=,year_month_day_last)

`constexpr year_month_day_last& operator-=(const months& m) noexcept;
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6882)

*Constraints*: If the argument supplied by the caller for the months parameter
is convertible to years,
its implicit conversion sequence to years is worse than its implicit conversion sequence tomonths ([[over.ics.rank]](over.ics.rank "12.2.4.3 Ranking implicit conversion sequences"))[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6890)

*Effects*: *this = *this - m[.](#6.sentence-1)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6894)

*Returns*: *this[.](#7.sentence-1)

[ð](#lib:operator+=,year_month_day_last_)

`constexpr year_month_day_last& operator+=(const years& y) noexcept;
`

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6905)

*Effects*: *this = *this + y[.](#8.sentence-1)

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6909)

*Returns*: *this[.](#9.sentence-1)

[ð](#lib:operator-=,year_month_day_last_)

`constexpr year_month_day_last& operator-=(const years& y) noexcept;
`

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6920)

*Effects*: *this = *this - y[.](#10.sentence-1)

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6924)

*Returns*: *this[.](#11.sentence-1)

[ð](#lib:year,year_month_day_last)

`constexpr chrono::year year() const noexcept;
`

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6935)

*Returns*: y_[.](#12.sentence-1)

[ð](#lib:month,year_month_day_last)

`constexpr chrono::month month() const noexcept;
`

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6946)

*Returns*: mdl_.month()[.](#13.sentence-1)

[ð](#lib:month_day_last,year_month_day_last)

`constexpr chrono::month_day_last month_day_last() const noexcept;
`

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6957)

*Returns*: mdl_[.](#14.sentence-1)

[ð](#lib:day,year_month_day_last)

`constexpr chrono::day day() const noexcept;
`

[15](#15)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6968)

*Returns*: If ok() is true,
returns a day representing
the last day of the (year, month) pair
represented by *this[.](#15.sentence-1)

Otherwise, the returned value is unspecified[.](#15.sentence-2)

[16](#16)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6976)

[*Note [1](#note-1)*:

This value might be computed on demand[.](#16.sentence-1)

â *end note*]

[ð](#lib:operator_sys_days,year_month_day_last)

`constexpr operator sys_days() const noexcept;
`

[17](#17)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6988)

*Returns*: sys_days{year()/month()/day()}[.](#17.sentence-1)

[ð](#lib:operator_local_days,year_month_day_last)

`constexpr explicit operator local_days() const noexcept;
`

[18](#18)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L6999)

*Returns*: local_days{sys_days{*this}.time_since_epoch()}[.](#18.sentence-1)

[ð](#lib:ok,year_month_day_last)

`constexpr bool ok() const noexcept;
`

[19](#19)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7010)

*Returns*: y_.ok() && mdl_.ok()[.](#19.sentence-1)
