|
Sen API
Sen Libraries
|
A point in time. More...
#include <timestamp.h>
Public Types | |
| using | ValueType = Duration::ValueType |
Public Member Functions | |
| constexpr | TimeStamp () noexcept=default |
| constexpr | TimeStamp (Duration timeSinceEpoch) noexcept |
| ~TimeStamp () noexcept=default | |
| constexpr Duration | sinceEpoch () const noexcept |
| Time passed since 1 January 1970 UTC. | |
| constexpr bool | operator== (const TimeStamp &other) const noexcept |
| Compares two Timestamps to determine if they are equal. | |
| constexpr bool | operator!= (const TimeStamp &other) const noexcept |
| Compares two Timestamps to determine if they are not equal. | |
| constexpr bool | operator< (const TimeStamp &other) const noexcept |
| True if *this is less than other. | |
| constexpr bool | operator<= (const TimeStamp &other) const noexcept |
| True if *this is less or equal than other. | |
| constexpr bool | operator> (const TimeStamp &other) const noexcept |
| True if *this is greater than other. | |
| constexpr bool | operator>= (const TimeStamp &other) const noexcept |
| True if *this is greater or equal than other. | |
| TimeStamp & | operator+= (const Duration &other) noexcept |
| Adds other to *this and returns *this. | |
| constexpr TimeStamp | operator+ (const Duration &other) const noexcept |
| Returns a TimeStamp of *this + other. | |
| TimeStamp & | operator-= (const Duration &other) noexcept |
| Removes other from *this and returns *this. | |
| constexpr TimeStamp | operator- (const Duration &other) const noexcept |
| Returns a TimeStamp of *this - other. | |
| constexpr Duration | operator- (const TimeStamp &other) const noexcept |
| Returns a Duration of *this - other. | |
| std::string | toUtcString () const |
| UTC string representation. Format Y-m-d H:M:S uuuuuu (microsecond precision). | |
| std::string | toUtcStringNs () const |
| UTC string representation in RFC 3339 with nanosecond fractional digits (2024-01-15T10:30:45.123456789Z). Lossless across the full nanosecond range. | |
| std::string | toLocalString () const |
| Local string representation of this time point. | |
Static Public Member Functions | |
| static Result< TimeStamp, std::string > | make (const std::string_view iso8601Time) |
A point in time.
|
constexprdefaultnoexcept |
|
inlineexplicitconstexprnoexcept |
|
defaultnoexcept |
|
inlinenodiscardconstexprnoexcept |
Time passed since 1 January 1970 UTC.
|
inlineconstexprnoexcept |
Compares two Timestamps to determine if they are equal.
|
inlineconstexprnoexcept |
Compares two Timestamps to determine if they are not equal.
|
inlineconstexprnoexcept |
True if *this is less than other.
|
inlineconstexprnoexcept |
True if *this is less or equal than other.
|
inlineconstexprnoexcept |
True if *this is greater than other.
|
inlineconstexprnoexcept |
True if *this is greater or equal than other.
Adds other to *this and returns *this.
Returns a TimeStamp of *this + other.
Removes other from *this and returns *this.
Returns a TimeStamp of *this - other.
Returns a Duration of *this - other.
|
nodiscard |
UTC string representation. Format Y-m-d H:M:S uuuuuu (microsecond precision).
|
nodiscard |
UTC string representation in RFC 3339 with nanosecond fractional digits (2024-01-15T10:30:45.123456789Z). Lossless across the full nanosecond range.
|
nodiscard |
Local string representation of this time point.