std::chrono::hh_mm_ss

From cppreference.com
< cpp‎ | chrono
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)
 
Date and time utilities
Time point
(C++11)
(C++20)
Duration
(C++11)
Clocks
(C++11)      
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time of day
(C++20)(C++20)
(C++20)(C++20)
hh_mm_ss
(C++20)

Calendars
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
Time zones
(C++20)
(C++20)
(C++20)
chrono I/O
(C++20)
C-style date and time
 
 
Defined in header <chrono>
template< class Duration >
class hh_mm_ss;
(since C++20)

The class template hh_mm_ss splits a std::chrono::duration into a "broken down" time such as hours:minutes:seconds, with the precision of the split determined by the Duration template parameter. It is primarily a formatting tool.

Duration must be a specialization of std::chrono::duration, otherwise the program is ill-formed.

Member Constants

constexpr unsigned fractional_width
[static]
the smallest possible integer in the range [018] such that precision (see below) will exactly represent the value of Duration{1}, or 6 if there's no such integer
(public static member constant)

Member types

Member type Definition
precision

std::chrono::duration<std::common_type_t<Duration::rep, std::chrono::seconds::rep>,                       std::ratio<1, 10fractional_width>>

Member functions

constructs a hh_mm_ss
(public member function)
obtains components of the broken-down time
(public member function)
obtains the stored std::chrono::duration
(public member function)

Non-member functions

outputs a hh_mm_ss into a stream
(function template)

Helper classes

formatting support for hh_mm_ss
(class template specialization)