MT Core (C++)
Core library for replacing C++ standard in project usage
|
Base calendar system tracking the number of days (and fraction of days) since its epoch. More...
#include <fixed.hpp>
Public Member Functions | |
constexpr bool | is_valid () const |
Checks that a moment is valid. | |
constexpr Moment | to_moment () const |
Time Calendar System contract. | |
constexpr auto | operator<=> (const Moment &o) const |
Time Calendar System contract. | |
constexpr Moment | add_days (const i32 days) const |
Adds n days to a moment. | |
constexpr Moment | sub_days (const i32 days) const |
Subtracts n days from a moment. | |
constexpr i32 | day_difference (const Moment &other) const |
Get the difference in days between two moments. | |
Static Public Member Functions | |
static constexpr Moment | from_moment (Moment m) |
Time Calendar System contract. | |
static constexpr Fixed | moment_to_fixed (const Moment &m) |
Converts a moment to fixed date (drops time) | |
static constexpr Moment | reconstruct (const Fixed &f, const Moment &m) |
Reconstructs a moment from a fixed date and the time portion of a moment. | |
Public Attributes | |
f64 | dayAndTime |
Static Public Attributes | |
static constexpr auto | EPOCH = FIXED_EPOCH |
static constexpr std::string_view | name = "MOMENT" |
Base calendar system tracking the number of days (and fraction of days) since its epoch.
Used as common ground for conversions between calendar systems with time.
|
inlinenodiscardconstexpr |
Get the difference in days between two moments.
Definition at line 298 of file fixed.hpp.
|
inlinenodiscardconstexpr |
|
inlinestaticnodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinestaticnodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
staticconstexpr |
|
staticconstexpr |