Xpace
Xpace::DateTime Class Reference

#include <datetime.h>

Public Member Functions

 DateTime (const Date &date=Date(), const Time &time=Time())
 @ param date the date @ param time the time More...
 
 DateTime (const String &str, const String &format)
 
void set (const Date &date, const Time &time)
 @ param date the date @ param time the time More...
 
Date getDate () const
 
Time getTime () const
 
int64 toInt (uint precision=0) const
 
 DateTime (int64 val, uint precision=0)
 set the date-time from an int64 More...
 
DateTimeoperator+= (int delta)
 increment/decrement the date-time More...
 
String toString (const String &format) const
 

Detailed Description

Definition at line 222 of file datetime.h.

Constructor & Destructor Documentation

Xpace::DateTime::DateTime ( const Date date = Date(),
const Time time = Time() 
)

@ param date the date @ param time the time

Xpace::DateTime::DateTime ( const String str,
const String format 
)
Parameters
thedate-time in string form
formatthe format of the date-time e.g. "yyyy-MM-dd hh:mm:ss"
Xpace::DateTime::DateTime ( int64  val,
uint  precision = 0 
)

set the date-time from an int64

Parameters
valthe int64
precisionthe desired precision

Member Function Documentation

void Xpace::DateTime::set ( const Date date,
const Time time 
)

@ param date the date @ param time the time

Date Xpace::DateTime::getDate ( ) const
inline

Definition at line 309 of file datetime.h.

References getTime().

Referenced by Xpace::Time::Time().

Time Xpace::DateTime::getTime ( ) const
inline

Definition at line 317 of file datetime.h.

Referenced by getDate().

int64 Xpace::DateTime::toInt ( uint  precision = 0) const
Parameters
thedesired precision 0 = seconds, 1 = tenths, 2 = hundredths, 3 = milliseconds
Returns
the date-time as an int64
DateTime& Xpace::DateTime::operator+= ( int  delta)

increment/decrement the date-time

Parameters
incrementthe date-time by this many units. if precision == 0, unit = second; if precision = 1, unit = tenths; etc.
String Xpace::DateTime::toString ( const String format) const
Parameters
formatthe format of the date-time e.g. "yyyy-MM-dd hh:mm:ss"

The documentation for this class was generated from the following file:

current as of Wed Jun 10 2026 12:00:06