Hyper API for C++ 0.0.20746
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>

Classes

struct  raw_t
 Marker struct for the raw timestamp constructor. More...
 

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.
 
 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 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.


Class Documentation

◆ hyperapi::OffsetTimestamp::raw_t

struct hyperapi::OffsetTimestamp::raw_t

Marker struct for the raw timestamp constructor.

Definition at line 22 of file OffsetTimestamp.hpp.

Constructor & Destructor Documentation

◆ OffsetTimestamp() [1/3]

hyperapi::OffsetTimestamp::OffsetTimestamp ( )
inlinenoexcept

Default constructor.

Definition at line 27 of file OffsetTimestamp.hpp.

◆ 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
dateThe date component.
timeThe time component.
offsetThe 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
rawTimestampThe raw timestamp value.

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: