[time.cal.ymdlast.nonmembers]

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

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

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

#### 30.8.15.3 Non-member functions [time.cal.ymdlast.nonmembers]

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

`constexpr bool operator==(const year_month_day_last& x, const year_month_day_last& y) noexcept;
`

[1](#1)

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

*Returns*: x.year() == y.year() && x.month_day_last() == y.month_day_last()[.](#1.sentence-1)

[ð](#lib:operator%3c=%3e,year_month_day_last)

`constexpr strong_ordering operator<=>(const year_month_day_last& x,
                                      const year_month_day_last& y) noexcept;
`

[2](#2)

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

*Effects*: Equivalent to:if (auto c = x.year() <=> y.year(); c != 0) return c;return x.month_day_last() <=> y.month_day_last();

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

`constexpr year_month_day_last
  operator+(const year_month_day_last& ymdl, const months& dm) noexcept;
`

[3](#3)

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

*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"))[.](#3.sentence-1)

[4](#4)

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

*Returns*: (ymdl.year() / ymdl.month() + dm) / last[.](#4.sentence-1)

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

`constexpr year_month_day_last
  operator+(const months& dm, const year_month_day_last& ymdl) noexcept;
`

[5](#5)

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

*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#L7079)

*Returns*: ymdl + dm[.](#6.sentence-1)

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

`constexpr year_month_day_last
  operator-(const year_month_day_last& ymdl, const months& dm) noexcept;
`

[7](#7)

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

*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"))[.](#7.sentence-1)

[8](#8)

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

*Returns*: ymdl + (-dm)[.](#8.sentence-1)

[ð](#lib:operator+,year_month_day_last__)

`constexpr year_month_day_last
  operator+(const year_month_day_last& ymdl, const years& dy) noexcept;
`

[9](#9)

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

*Returns*: {ymdl.year()+dy, ymdl.month_day_last()}[.](#9.sentence-1)

[ð](#lib:operator+,year_month_day_last___)

`constexpr year_month_day_last
  operator+(const years& dy, const year_month_day_last& ymdl) noexcept;
`

[10](#10)

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

*Returns*: ymdl + dy[.](#10.sentence-1)

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

`constexpr year_month_day_last
  operator-(const year_month_day_last& ymdl, const years& dy) noexcept;
`

[11](#11)

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

*Returns*: ymdl + (-dy)[.](#11.sentence-1)

[ð](#lib:operator%3c%3c,year_month_day_last)

`template<class charT, class traits>
  basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const year_month_day_last& ymdl);
`

[12](#12)

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

*Effects*: Equivalent to:return os << format(os.getloc(), *STATICALLY-WIDEN*<charT>("{}/{:L}"),
 ymdl.year(), ymdl.month_day_last());
