26 Time library [time]

26.9 Class template time_­of_­day [time.tod]

26.9.4 Seconds precision [time.tod.seconds]

namespace std::chrono {
  template<>
  class time_of_day<seconds> {
  public:
    using precision = chrono::seconds;

    time_of_day() = default;
    constexpr explicit time_of_day(chrono::seconds since_midnight) noexcept;

    constexpr chrono::hours   hours()   const noexcept;
    constexpr chrono::minutes minutes() const noexcept;
    constexpr chrono::seconds seconds() const noexcept;

    constexpr explicit operator  precision()   const noexcept;
    constexpr          precision to_duration() const noexcept;

    constexpr void make24() noexcept;
    constexpr void make12() noexcept;
  };
}
[Note
:
This specialization handles hours, minutes, and seconds since midnight.
end note
]
constexpr explicit time_of_day(seconds since_midnight) noexcept;
Effects: Constructs an object of type time_­of_­day in 24-hour format corresponding to since_­midnight seconds after 00:00:00.
Ensures: hours() returns the integral number of hours since_­midnight is after 00:00:00.
minutes() returns the integral number of minutes since_­midnight is after (00:00:00 + hours()).
seconds() returns the integral number of seconds since_­midnight is after (00:00:00 + hours() + minutes()).
constexpr chrono::hours hours() const noexcept;
Returns: The stored hour of *this.
constexpr chrono::minutes minutes() const noexcept;
Returns: The stored minute of *this.
constexpr chrono::seconds seconds() const noexcept;
Returns: The stored second of *this.
constexpr explicit operator precision() const noexcept;
Returns: The number of seconds since midnight.
constexpr precision to_duration() const noexcept;
Returns: precision{*this}.
constexpr void make24() noexcept;
Effects: If *this is a 12-hour time, converts to a 24-hour time.
Otherwise, no effects.
constexpr void make12() noexcept;
Effects: If *this is a 24-hour time, converts to a 12-hour time.
Otherwise, no effects.