A timestamp data value with an offset to UTC.
More...
#include <OffsetTimestamp.hpp>
|
| 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.
|
|
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.
◆ OffsetTimestamp() [1/2]
hyperapi::OffsetTimestamp::OffsetTimestamp |
( |
| ) |
|
|
inlinenoexcept |
◆ OffsetTimestamp() [2/2]
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. |
◆ 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: