Hyper API for C++ 0.0.18825
Hyper client library for C++ applications
Loading...
Searching...
No Matches
hyperapi::OffsetTimestamp Class Referencefinal

A timestamp data value with an offset to UTC. More...

#include <OffsetTimestamp.hpp>

Public Member Functions

 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 DategetDate () const noexcept
 Gets the date component of the timestamp.
 
const TimegetTime () 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.
 

Detailed Description

A timestamp data value with an offset to UTC.

Definition at line 17 of file OffsetTimestamp.hpp.

Constructor & Destructor Documentation

◆ OffsetTimestamp() [1/2]

hyperapi::OffsetTimestamp::OffsetTimestamp ( )
inlinenoexcept

Default constructor.

Definition at line 22 of file OffsetTimestamp.hpp.

◆ 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
dateThe date component.
timeThe time component.
offsetThe offset to UTC in minutes.

Member Function Documentation

◆ 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: