std::chrono::year::is_leap

From cppreference.com
< cpplrm; | chronolrm; | year
Date and time utilities
(C++11)
(C++11)
Clocks
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Calendars
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time zones
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
C-style date and time
constexpr bool is_leap() const noexcept;
(since C++20)

Determines if *this represents a leap year in the proleptic Gregorian calendar.

*this represents a leap year if the stored year value

  • is divisible by 4 and not divisible by 100; or
  • is divisible by 400.

Return value

true if *this represents a leap year, otherwise false.