27 Time library [time]

27.11 Time zones [time.zone]

27.11.8 Class leap [time.zone.leap]

27.11.8.1 Overview [time.zone.leap.overview]

namespace std::chrono {
  class leap {
  public:
    leap(const leap&)            = default;
    leap& operator=(const leap&) = default;

    // unspecified additional constructors

    constexpr sys_seconds date() const noexcept;
  };
}
Objects of type leap representing the date of the leap second insertions are constructed and stored in the time zone database when initialized.
Example
:
for (auto& l : get_tzdb().leaps)
  if (l <= 2018y/March/17d)
    cout << l.date() << '\n';
Produces the output:
1972-07-01 00:00:00
1973-01-01 00:00:00
1974-01-01 00:00:00
1975-01-01 00:00:00
1976-01-01 00:00:00
1977-01-01 00:00:00
1978-01-01 00:00:00
1979-01-01 00:00:00
1980-01-01 00:00:00
1981-07-01 00:00:00
1982-07-01 00:00:00
1983-07-01 00:00:00
1985-07-01 00:00:00
1988-01-01 00:00:00
1990-01-01 00:00:00
1991-01-01 00:00:00
1992-07-01 00:00:00
1993-07-01 00:00:00
1994-07-01 00:00:00
1996-01-01 00:00:00
1997-07-01 00:00:00
1999-01-01 00:00:00
2006-01-01 00:00:00
2009-01-01 00:00:00
2012-07-01 00:00:00
2015-07-01 00:00:00
2017-01-01 00:00:00
— end example
 ]

27.11.8.2 Member functions [time.zone.leap.members]

constexpr sys_seconds date() const noexcept;
Returns: The date and time at which the leap second was inserted.

27.11.8.3 Non-member functions [time.zone.leap.nonmembers]

constexpr bool operator==(const leap& x, const leap& y) noexcept;
Returns: x.date() == y.date().
constexpr strong_ordering operator<=>(const leap& x, const leap& y) noexcept;
Returns: x.date() <=> y.date().
template<class Duration> constexpr bool operator==(const leap& x, const sys_time<Duration>& y) noexcept;
Returns: x.date() == y.
template<class Duration> constexpr bool operator<(const leap& x, const sys_time<Duration>& y) noexcept;
Returns: x.date() < y.
template<class Duration> constexpr bool operator<(const sys_time<Duration>& x, const leap& y) noexcept;
Returns: x < y.date().
template<class Duration> constexpr bool operator>(const leap& x, const sys_time<Duration>& y) noexcept;
Returns: y < x.
template<class Duration> constexpr bool operator>(const sys_time<Duration>& x, const leap& y) noexcept;
Returns: y < x.
template<class Duration> constexpr bool operator<=(const leap& x, const sys_time<Duration>& y) noexcept;
Returns: !(y < x).
template<class Duration> constexpr bool operator<=(const sys_time<Duration>& x, const leap& y) noexcept;
Returns: !(y < x).
template<class Duration> constexpr bool operator>=(const leap& x, const sys_time<Duration>& y) noexcept;
Returns: !(x < y).
template<class Duration> constexpr bool operator>=(const sys_time<Duration>& x, const leap& y) noexcept;
Returns: !(x < y).
template<three_way_comparable_with<sys_seconds> Duration> constexpr auto operator<=>(const leap& x, const sys_time<Duration>& y) noexcept;
Returns: x.date() <=> y.