A timestamp data value with an offset to UTC.
More...
#include <OffsetTimestamp.hpp>
|
struct | raw_t |
| Marker struct for the raw timestamp constructor. More...
|
|
|
| OffsetTimestamp () noexcept |
| Default constructor.
|
|
| OffsetTimestamp (Date date, Time time, std::chrono::minutes offset) noexcept |
| Creates a timestamp value with a date, time, and offset component.
|
|
| OffsetTimestamp (hyper_timestamp_t rawTimestamp, raw_t) noexcept |
| Creates a timestamp from a raw timestamp value encoded as microseconds since 1 January 4713 BC.
|
|
const Date & | getDate () const noexcept |
| Gets the date component of the timestamp.
|
|
const Time & | getTime () const noexcept |
| Gets the time component of the timestamp.
|
|
std::chrono::minutes | getOffset () const noexcept |
| Gets the offset to UTC of the timestamp in minutes.
|
|
hyper_timestamp_t | getRaw () const noexcept |
| Gets the raw timestamp value encoded as microseconds since 1 January 4713 BC.
|
|
std::string | toString () const |
| Returns a string representation for debugging.
|
|
A timestamp data value with an offset to UTC.
Definition at line 17 of file OffsetTimestamp.hpp.
◆ hyperapi::OffsetTimestamp::raw_t
struct hyperapi::OffsetTimestamp::raw_t |
◆ OffsetTimestamp() [1/3]
hyperapi::OffsetTimestamp::OffsetTimestamp |
( |
| ) |
|
|
inlinenoexcept |
◆ OffsetTimestamp() [2/3]
hyperapi::OffsetTimestamp::OffsetTimestamp |
( |
Date |
date, |
|
|
Time |
time, |
|
|
std::chrono::minutes |
offset |
|
) |
| |
|
noexcept |
Creates a timestamp value with a date, time, and offset component.
- Parameters
-
date | The date component. |
time | The time component. |
offset | The offset to UTC in minutes. |
◆ OffsetTimestamp() [3/3]
hyperapi::OffsetTimestamp::OffsetTimestamp |
( |
hyper_timestamp_t |
rawTimestamp, |
|
|
raw_t |
|
|
) |
| |
|
explicitnoexcept |
Creates a timestamp from a raw timestamp value encoded as microseconds since 1 January 4713 BC.
- Parameters
-
rawTimestamp | The raw timestamp value. |
◆ getDate()
const Date & hyperapi::OffsetTimestamp::getDate |
( |
| ) |
const |
|
noexcept |
Gets the date component of the timestamp.
- Returns
- The date component.
◆ getOffset()
std::chrono::minutes hyperapi::OffsetTimestamp::getOffset |
( |
| ) |
const |
|
noexcept |
Gets the offset to UTC of the timestamp in minutes.
- Returns
- The offset.
◆ getRaw()
hyper_timestamp_t hyperapi::OffsetTimestamp::getRaw |
( |
| ) |
const |
|
noexcept |
Gets the raw timestamp value encoded as microseconds since 1 January 4713 BC.
- Returns
- The raw timestamp value.
◆ getTime()
const Time & hyperapi::OffsetTimestamp::getTime |
( |
| ) |
const |
|
noexcept |
Gets the time component of the timestamp.
- Returns
- The time component.
◆ toString()
std::string hyperapi::OffsetTimestamp::toString |
( |
| ) |
const |
Returns a string representation for debugging.
The returned string is in the format <date> <time><offset>
, where <date>
is formatted as ±YYYY-MM-DD
, <time>
as HH:MM:SS.ssssss
, and offset as ±HH:MM
.
The documentation for this class was generated from the following file: