[time.cal.md.nonmembers]

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

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

### 30.8.9 Class month_day [[time.cal.md]](time.cal.md#nonmembers)

#### 30.8.9.3 Non-member functions [time.cal.md.nonmembers]

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

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

[1](#1)

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

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

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

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

[2](#2)

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

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

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

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

[3](#3)

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

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

[ð](#lib:from_stream,month_day)

`template<class charT, class traits, class Alloc = allocator<charT>>
  basic_istream<charT, traits>&
    from_stream(basic_istream<charT, traits>& is, const charT* fmt,
                month_day& md, basic_string<charT, traits, Alloc>* abbrev = nullptr,
                minutes* offset = nullptr);
`

[4](#4)

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

*Effects*: Attempts to parse the input stream is into the month_day md using
the format flags given in the NTCTS fmt as specified in [[time.parse]](time.parse "30.13 Parsing")[.](#4.sentence-1)

If the parse fails to decode a valid month_day,is.setstate(ios_base​::​failbit) is called andmd is not modified[.](#4.sentence-2)

If %Z is used and successfully parsed,
that value will be assigned to *abbrev if abbrev is non-null[.](#4.sentence-3)

If %z (or a modified variant) is used and successfully parsed,
that value will be assigned to *offset if offset is non-null[.](#4.sentence-4)

[5](#5)

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

*Returns*: is[.](#5.sentence-1)
