userver: utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > > Class Template Reference
Loading...
Searching...
No Matches
utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > > Class Template Reference

Detailed Description

template<typename Rep, typename Period>
class utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >

Definition at line 77 of file time_of_day.hpp.

Public Types

using DurationType = std::chrono::duration<Rep, Period>

Public Member Functions

Duration arithmetic
constexpr TimeOfDay (DurationType) noexcept
template<typename ORep, typename OPeriod>
constexpr TimeOfDay (std::chrono::duration< ORep, OPeriod >) noexcept
constexpr TimeOfDay (std::string_view)
Comparison operators
constexpr auto operator<=> (const TimeOfDay &) const =default

Accessors

constexpr std::chrono::hours Hours () const noexcept
constexpr std::chrono::minutes Minutes () const noexcept
constexpr std::chrono::seconds Seconds () const noexcept
constexpr DurationType Subseconds () const noexcept
constexpr DurationType SinceMidnight () const noexcept
static constexpr TimeOfDay FromHHMMInt (int)
 Create time of day from integer representation, e.g.1330 => 13:30.

Member Typedef Documentation

◆ DurationType

template<typename Rep, typename Period>
using utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::DurationType = std::chrono::duration<Rep, Period>

Definition at line 79 of file time_of_day.hpp.

Constructor & Destructor Documentation

◆ TimeOfDay() [1/3]

template<typename Rep, typename Period>
utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::TimeOfDay ( DurationType d)
explicitconstexprnoexcept

Definition at line 402 of file time_of_day.hpp.

◆ TimeOfDay() [2/3]

template<typename Rep, typename Period>
template<typename ORep, typename OPeriod>
utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::TimeOfDay ( std::chrono::duration< ORep, OPeriod > d)
explicitconstexprnoexcept

Definition at line 407 of file time_of_day.hpp.

◆ TimeOfDay() [3/3]

template<typename Rep, typename Period>
utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::TimeOfDay ( std::string_view str)
explicitconstexpr

Definition at line 411 of file time_of_day.hpp.

Member Function Documentation

◆ FromHHMMInt()

template<typename Rep, typename Period>
TimeOfDay< std::chrono::duration< Rep, Period > > utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::FromHHMMInt ( int hh_mm)
staticconstexpr

Create time of day from integer representation, e.g.1330 => 13:30.

Definition at line 454 of file time_of_day.hpp.

◆ Hours()

template<typename Rep, typename Period>
std::chrono::hours utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Hours ( ) const
inlineconstexprnoexcept
Returns
Hours since midnight

Definition at line 95 of file time_of_day.hpp.

◆ Minutes()

template<typename Rep, typename Period>
std::chrono::minutes utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Minutes ( ) const
constexprnoexcept
Returns
Minutes since midnight + Hours

Definition at line 416 of file time_of_day.hpp.

◆ Seconds()

template<typename Rep, typename Period>
std::chrono::seconds utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Seconds ( ) const
constexprnoexcept
Returns
Seconds since midnight + Hours + Minutes

Definition at line 426 of file time_of_day.hpp.

◆ SinceMidnight()

template<typename Rep, typename Period>
TimeOfDay< std::chrono::duration< Rep, Period > >::DurationType utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::SinceMidnight ( ) const
constexprnoexcept
Returns
Underlying duration representation

Definition at line 448 of file time_of_day.hpp.

◆ Subseconds()

template<typename Rep, typename Period>
TimeOfDay< std::chrono::duration< Rep, Period > >::DurationType utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Subseconds ( ) const
constexprnoexcept
Returns
Fractional part of seconds since midnight + Hours + Minutes + Seconds up to resolution

Definition at line 438 of file time_of_day.hpp.


The documentation for this class was generated from the following file: