GATE
Loading...
Searching...
No Matches
Time Struct Reference

System time class (timestamp + UTC bias) More...

#include <times.hpp>

Public Member Functions

 Time (timestamp_t microsince1601=0, int32_t biasminutes=0)
 
DateTime toDateTime () const
 
String toString () const
 
String toString (String const &format) const
 
int64_t toUnix () const
 
Time add (int64_t microseconds) const
 
int64_t diff (Time const &t) const
 

Static Public Member Functions

static Time now ()
 
static Result< TimetryParse (String const &text)
 
static Time parse (String const &text)
 
static Time fromUnix (int64_t unixSeconds)
 
static Time fromTimestamp (gate_timestamp_t source)
 

Detailed Description

System time class (timestamp + UTC bias)

Constructor & Destructor Documentation

◆ Time()

Time ( timestamp_t microsince1601 = 0,
int32_t biasminutes = 0 )

Initializes Time object

Member Function Documentation

◆ now()

Time now ( )
static

Creates time from current system time

◆ tryParse()

Result< Time > tryParse ( String const & text)
static

Creates time by parsing ISO8601 time string

◆ parse()

Time parse ( String const & text)
static

Creates time by parsing ISO8601 time string

◆ fromUnix()

Time fromUnix ( int64_t unixSeconds)
static

Creates time from an UNIX timestamp

◆ fromTimestamp()

Time fromTimestamp ( gate_timestamp_t source)
static

Creates time from GATE timestamp

◆ toDateTime()

DateTime toDateTime ( ) const

Converts time to gregorian date-time

◆ toString() [1/2]

String toString ( ) const

Prints time as string

◆ toString() [2/2]

String toString ( String const & format) const

Prints time as formated string

◆ toUnix()

int64_t toUnix ( ) const

Converts time into UNIX timestamp

◆ add()

Time add ( int64_t microseconds) const

Adds microseconds to current time and returns new Time object

◆ diff()

int64_t diff ( Time const & t) const

Returns difference between current and given time in microseconds


The documentation for this struct was generated from the following files: