namespace std::chrono { class weekday { unsigned char wd_; // exposition only public: weekday() = default; explicit constexpr weekday(unsigned wd) noexcept; constexpr weekday(const sys_days& dp) noexcept; explicit constexpr weekday(const local_days& dp) noexcept; constexpr weekday& operator++() noexcept; constexpr weekday operator++(int) noexcept; constexpr weekday& operator--() noexcept; constexpr weekday operator--(int) noexcept; constexpr weekday& operator+=(const days& d) noexcept; constexpr weekday& operator-=(const days& d) noexcept; explicit constexpr operator unsigned() const noexcept; constexpr bool ok() const noexcept; constexpr weekday_indexed operator[](unsigned index) const noexcept; constexpr weekday_last operator[](last_spec) const noexcept; }; }

weekday represents a day of the week in the civil calendar.

It normally holds values in the range 0 to 6,
corresponding to Sunday through Saturday, but
it may hold non-negative values outside this range.

It can be constructed with any unsigned value,
which will be subsequently truncated to fit into weekday's unspecified internal storage.

```
explicit constexpr weekday(unsigned wd) noexcept;
```

```
constexpr weekday(const sys_days& dp) noexcept;
```

```
explicit constexpr weekday(const local_days& dp) noexcept;
```

```
constexpr weekday& operator++() noexcept;
```

```
constexpr weekday operator++(int) noexcept;
```

```
constexpr weekday& operator--() noexcept;
```

```
constexpr weekday operator--(int) noexcept;
```

```
constexpr weekday& operator+=(const days& d) noexcept;
```

```
constexpr weekday& operator-=(const days& d) noexcept;
```

```
explicit constexpr operator unsigned() const noexcept;
```

```
constexpr bool ok() const noexcept;
```

```
constexpr weekday_indexed operator[](unsigned index) const noexcept;
```

```
constexpr weekday_last operator[](last_spec) const noexcept;
```

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

```
constexpr weekday operator+(const weekday& x, const days& y) noexcept;
```

Returns:

weekday{modulo(static_cast<long long>(unsigned{x}) + y.count(), 7)}where modulo(n, 7) computes the remainder of n divided by 7 using Euclidean division.

```
constexpr weekday operator+(const days& x, const weekday& y) noexcept;
```

```
constexpr weekday operator-(const weekday& x, const days& y) noexcept;
```

```
constexpr days operator-(const weekday& x, const weekday& y) noexcept;
```

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

```
template<class charT, class traits>
basic_ostream<charT, traits>&
to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const weekday& wd);
```

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

Effects:
Attempts to parse the input stream is
into the weekday wd using
the format flags given in the NTCTS fmt
as specified in [time.parse].

If the parse fails to decode a valid weekday,
is.setstate(ios_base::failbit) shall be called
and wd shall not be modified.

If %Z is used and successfully parsed,
that value will be assigned to *abbrev if abbrev is non-null.

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