Hyper API for C++  0.0.16638
Hyper client library for C++ applications
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. More...
 
const DategetDate () const noexcept
 Gets the date component of the timestamp. More...
 
const TimegetTime () const noexcept
 Gets the time component of the timestamp. More...
 
std::chrono::minutes getOffset () const noexcept
 Gets the offset to UTC of the timestamp in minutes. More...
 
hyper_timestamp_t getRaw () const noexcept
 Gets the raw timestamp value encoded as microseconds since 1 January 4713 BC. More...
 
std::string toString () const
 Returns a string representation for debugging. More...
 

Friends

bool operator== (const OffsetTimestamp &lhs, const OffsetTimestamp &rhs) noexcept
 Equality operator.
 
bool operator> (const OffsetTimestamp &lhs, const OffsetTimestamp &rhs) noexcept
 Greater operator.
 
bool operator!= (const OffsetTimestamp &a, const OffsetTimestamp &b) noexcept
 Not equal operator.
 
bool operator< (const OffsetTimestamp &a, const OffsetTimestamp &b) noexcept
 Less than operator.
 
bool operator<= (const OffsetTimestamp &a, const OffsetTimestamp &b) noexcept
 Less than or equal operator.
 
bool operator>= (const OffsetTimestamp &a, const OffsetTimestamp &b) noexcept
 Greater or equal operator.
 
std::ostream & operator<< (std::ostream &os, const OffsetTimestamp &obj)
 Stream output operator.
 

Detailed Description

A timestamp data value with an offset to UTC.

Definition at line 17 of file OffsetTimestamp.hpp.

Constructor & Destructor Documentation

◆ OffsetTimestamp()

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: