hh_mm_ss
A type to hold hours, minutes, and seconds.
template <typename TDuration>
class hh_mm_ssDescription
Static asserts if TDuration is not a specialisation of etl::chrono::duration.
Constants
static constexpr int fractional_width;Description
The number of fractional digits.
Member types
precisionDescription
The return type for to_duration.
Constructors
ETL_CONSTEXPR
hh_mm_ss()
ETL_NOEXCEPTDescription
Default constructor.
ETL_CONSTEXPR14
explicit hh_mm_ss(TDuration d)
ETL_NOEXCEPTDescription
Construct from duration.
Access
ETL_NODISCARD
ETL_CONSTEXPR14
bool is_negative() const
ETL_NOEXCEPTDescription
Checks for negative duration.
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::hours hours() const
ETL_NOEXCEPTReturn
The hours.
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::minutes minutes() const
ETL_NOEXCEPTReturn
The minutes.
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::seconds seconds() const
ETL_NOEXCEPTReturn
The seconds.
ETL_NODISCARD
ETL_CONSTEXPR14
precision subseconds() const
ETL_NOEXCEPTReturn
The subseconds.
ETL_NODISCARD
ETL_CONSTEXPR14
explicit operator precision() const
ETL_NOEXCEPTReturn
The duration.
ETL_NODISCARD
ETL_CONSTEXPR14
precision to_duration() const
ETL_NOEXCEPTReturn*
The duration.
absolute
template <typename TDuration>
ETL_NODISCARD
ETL_CONSTEXPR14
TDuration absolute(TDuration dur)
ETL_NOEXCEPTA specialisation of absolute for etl::chrono::duration.
Return
The absolute duration value.
12/24 hour functions
ETL_NODISCARD
inline ETL_CONSTEXPR14
bool is_am(const etl::chrono::hours& h)
ETL_NOEXCEPTDescription
Returns true if h is in the range [0h, 11h] (an am hour).
ETL_NODISCARD
inline ETL_CONSTEXPR14
bool is_pm(const etl::chrono::hours& h)
ETL_NOEXCEPTDescription
Returns true if h is in the range [12h, 23h] (a pm hour).
ETL_NODISCARD
inline ETL_CONSTEXPR14
etl::chrono::hours make12(const etl::chrono::hours& h)
ETL_NOEXCEPTDescription
Returns the 12-hour equivalent of h in the range [1h, 12h].
If h is not in the range [0h, 23h], the value returned is unspecified.
ETL_NODISCARD
inline ETL_CONSTEXPR14
etl::chrono::hours make24(const etl::chrono::hours& h, bool is_pm)
ETL_NOEXCEPTDescription
Returns the 24-hour equivalent of h, which is assumed to represent the hour with the indicated am/pm.
If h is not in the range [1h, 12h], the value returned is unspecified.