# std::chrono::month_day::month, std::chrono::month_day::day

> C++ Atlas: `cppatlas.com/w/cpp/chrono/month_day/accessors` | Source: https://en.cppreference.com/w/cpp/chrono/month_day/accessors | Domain: Date and time utilities | Standards: C++20

Retrieves the month and day values stored in this month_day object.

## Official Specification Summary (cppreference)

```cpp
constexpr std::chrono::month month() const noexcept; // (1) (since C++20)
constexpr std::chrono::day day() const noexcept; // (1) (since C++20)
```

Retrieves the month and day values stored in this `month_day` object.

### Return value

1) Returns the stored `std::chrono::month` value.

2) Returns the stored `std::chrono::day` value.

### Example

```cpp
#include <chrono>

int main()
{
    constexpr auto md{std::chrono::July/15};
    static_assert(md.month() == std::chrono::month(7));
    static_assert(md.day() == std::chrono::day(15));
}
```

---
Attribution: content from https://en.cppreference.com/w/cpp/chrono/month_day/accessors (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.