plugify 1.2.6
|
Public Member Functions | |
template<typename Rep , typename Period > | |
constexpr | DateTime (const std::chrono::duration< Rep, Period > &duration) noexcept |
Constructs a DateTime object from a duration. | |
template<typename T = float> | |
constexpr auto | AsSeconds () const noexcept |
Converts the time duration to seconds. | |
template<typename T = double> | |
constexpr auto | AsMilliseconds () const noexcept |
Converts the time duration to milliseconds. | |
template<typename T = uint64_t> | |
constexpr auto | AsMicroseconds () const noexcept |
Converts the time duration to microseconds. | |
template<typename Rep , typename Period > | |
constexpr | operator std::chrono::duration< Rep, Period > () const noexcept |
Converts the DateTime object to a standard chrono duration. | |
constexpr bool | operator== (const DateTime &rhs) const noexcept |
Compares if two DateTime objects are equal. | |
constexpr bool | operator!= (const DateTime &rhs) const noexcept |
Compares if two DateTime objects are not equal. | |
constexpr bool | operator< (const DateTime &rhs) const noexcept |
Compares if one DateTime object is less than another. | |
constexpr bool | operator<= (const DateTime &rhs) const noexcept |
Compares if one DateTime object is less than or equal to another. | |
constexpr bool | operator> (const DateTime &rhs) const noexcept |
Compares if one DateTime object is greater than another. | |
constexpr bool | operator>= (const DateTime &rhs) const noexcept |
Compares if one DateTime object is greater than or equal to another. | |
constexpr DateTime | operator- () const noexcept |
Negates the DateTime value. | |
constexpr DateTime & | operator+= (const DateTime &rhs) noexcept |
Adds another DateTime object to this one. | |
constexpr DateTime & | operator-= (const DateTime &rhs) noexcept |
Subtracts another DateTime object from this one. | |
constexpr DateTime & | operator*= (float rhs) noexcept |
Multiplies this DateTime object by a floating-point value. | |
constexpr DateTime & | operator*= (int64_t rhs) noexcept |
Multiplies this DateTime object by an integer value. | |
constexpr DateTime & | operator/= (float rhs) noexcept |
Divides this DateTime object by a floating-point value. | |
constexpr DateTime & | operator/= (int64_t rhs) noexcept |
Divides this DateTime object by an integer value. | |
Static Public Member Functions | |
template<typename T = float> | |
static constexpr DateTime | Seconds (const T &seconds) noexcept |
Creates a DateTime object representing seconds. | |
template<typename T = double> | |
static constexpr DateTime | Milliseconds (const T &milliseconds) noexcept |
Creates a DateTime object representing milliseconds. | |
template<typename T = uint64_t> | |
static constexpr DateTime | Microseconds (const T µseconds) noexcept |
Creates a DateTime object representing microseconds. | |
static DateTime | Now () noexcept |
Gets the current time since a local epoch. | |
static std::string | Get (std::string_view format="%Y-%m-%d %H:%M:%S") |
Gets the current system time formatted as a string. | |
Friends | |
constexpr friend DateTime | operator+ (const DateTime &lhs, const DateTime &rhs) noexcept |
Adds two DateTime objects. | |
constexpr friend DateTime | operator- (const DateTime &lhs, const DateTime &rhs) noexcept |
Subtracts one DateTime object from another. | |
constexpr friend DateTime | operator* (const DateTime &lhs, float rhs) noexcept |
Multiplies a DateTime object by a floating-point value. | |
constexpr friend DateTime | operator* (const DateTime &lhs, int64_t rhs) noexcept |
Multiplies a DateTime object by an integer value. | |
constexpr friend DateTime | operator* (float lhs, const DateTime &rhs) noexcept |
Multiplies a floating-point value by a DateTime object. | |
constexpr friend DateTime | operator* (int64_t lhs, const DateTime &rhs) noexcept |
Multiplies an integer value by a DateTime object. | |
constexpr friend DateTime | operator/ (const DateTime &lhs, float rhs) noexcept |
Divides a DateTime object by a floating-point value. | |
constexpr friend DateTime | operator/ (const DateTime &lhs, int64_t rhs) noexcept |
Divides a DateTime object by an integer value. | |
constexpr friend double | operator/ (const DateTime &lhs, const DateTime &rhs) noexcept |
Divides one DateTime object by another. | |
template<typename Period = std::ratio<1, 1>> | |
constexpr friend double | operator% (const DateTime &lhs, const DateTime &rhs) |
Computes the modulo (remainder) of one DateTime object divided by another. | |
Definition at line 10 of file date_time.hpp.
|
inlineconstexprnoexcept |
Constructs a DateTime object from a duration.
Rep | The representation type of the duration (e.g., int, float). |
Period | The period type of the duration (e.g., seconds, milliseconds). |
duration | The duration to initialize the DateTime object. |
Definition at line 21 of file date_time.hpp.
|
inlineconstexprnoexcept |
Converts the time duration to microseconds.
T | The return type of the value (default is uint64_t). |
Definition at line 72 of file date_time.hpp.
|
inlineconstexprnoexcept |
Converts the time duration to milliseconds.
T | The return type of the value (default is double). |
Definition at line 64 of file date_time.hpp.
|
inlineconstexprnoexcept |
Converts the time duration to seconds.
T | The return type of the value (default is float). |
Definition at line 56 of file date_time.hpp.
|
inlinestatic |
Gets the current system time formatted as a string.
format | The desired time format (default is "%Y-%m-%d %H:%M:%S"). |
Definition at line 87 of file date_time.hpp.
|
inlinestaticconstexprnoexcept |
Creates a DateTime object representing microseconds.
T | The type of the microseconds value (default is uint64_t). |
microseconds | The number of microseconds. |
Definition at line 48 of file date_time.hpp.
|
inlinestaticconstexprnoexcept |
Creates a DateTime object representing milliseconds.
T | The type of the milliseconds value (default is double). |
milliseconds | The number of milliseconds. |
Definition at line 39 of file date_time.hpp.
|
inlinestaticnoexcept |
Gets the current time since a local epoch.
Definition at line 78 of file date_time.hpp.
|
inlineexplicitconstexprnoexcept |
Converts the DateTime object to a standard chrono duration.
Rep | The representation type for the duration (e.g., int, float). |
Period | The period type for the duration (e.g., seconds, milliseconds). |
Definition at line 111 of file date_time.hpp.
|
inlineconstexprnoexcept |
Compares if two DateTime objects are not equal.
rhs | The right-hand side DateTime object. |
Definition at line 127 of file date_time.hpp.
|
inlineconstexprnoexcept |
Multiplies this DateTime object by a floating-point value.
rhs | The multiplier value. |
Definition at line 251 of file date_time.hpp.
|
inlineconstexprnoexcept |
Multiplies this DateTime object by an integer value.
rhs | The multiplier value. |
Definition at line 257 of file date_time.hpp.
Adds another DateTime object to this one.
rhs | The DateTime object to add. |
Definition at line 239 of file date_time.hpp.
|
inlineconstexprnoexcept |
Negates the DateTime value.
Definition at line 156 of file date_time.hpp.
Subtracts another DateTime object from this one.
rhs | The DateTime object to subtract. |
Definition at line 245 of file date_time.hpp.
|
inlineconstexprnoexcept |
Divides this DateTime object by a floating-point value.
rhs | The divisor value. |
Definition at line 263 of file date_time.hpp.
|
inlineconstexprnoexcept |
Divides this DateTime object by an integer value.
rhs | The divisor value. |
Definition at line 269 of file date_time.hpp.
|
inlineconstexprnoexcept |
Compares if one DateTime object is less than another.
rhs | The right-hand side DateTime object. |
Definition at line 133 of file date_time.hpp.
|
inlineconstexprnoexcept |
Compares if one DateTime object is less than or equal to another.
rhs | The right-hand side DateTime object. |
Definition at line 139 of file date_time.hpp.
|
inlineconstexprnoexcept |
Compares if two DateTime objects are equal.
rhs | The right-hand side DateTime object. |
Definition at line 121 of file date_time.hpp.
|
inlineconstexprnoexcept |
Compares if one DateTime object is greater than another.
rhs | The right-hand side DateTime object. |
Definition at line 145 of file date_time.hpp.
|
inlineconstexprnoexcept |
Compares if one DateTime object is greater than or equal to another.
rhs | The right-hand side DateTime object. |
Definition at line 151 of file date_time.hpp.
|
inlinestaticconstexprnoexcept |
Creates a DateTime object representing seconds.
T | The type of the seconds value (default is float). |
seconds | The number of seconds. |
Definition at line 30 of file date_time.hpp.
|
friend |
Computes the modulo (remainder) of one DateTime object divided by another.
Period | The time unit for the modulo operation (default is seconds). |
Definition at line 230 of file date_time.hpp.
Multiplies a DateTime object by a floating-point value.
lhs | The DateTime object. |
rhs | The multiplier value. |
Definition at line 178 of file date_time.hpp.
Multiplies a DateTime object by an integer value.
lhs | The DateTime object. |
rhs | The multiplier value. |
Definition at line 185 of file date_time.hpp.
Multiplies a floating-point value by a DateTime object.
lhs | The multiplier value. |
rhs | The DateTime object. |
Definition at line 192 of file date_time.hpp.
Multiplies an integer value by a DateTime object.
lhs | The multiplier value. |
rhs | The DateTime object. |
Definition at line 199 of file date_time.hpp.
Divides one DateTime object by another.
Definition at line 220 of file date_time.hpp.
Divides a DateTime object by a floating-point value.
lhs | The DateTime object. |
rhs | The divisor value. |
Definition at line 206 of file date_time.hpp.
Divides a DateTime object by an integer value.
lhs | The DateTime object. |
rhs | The divisor value. |
Definition at line 213 of file date_time.hpp.