#include <DateTime.hpp>
Public Member Functions | |
Date | date () const |
getter to date member More... | |
DateTime () | |
default constructor, UTC time is assumed More... | |
DateTime (const Date &date) | |
constructor from Date, UTC time is assumed More... | |
DateTime (const Date &date, const Time &timeFromDate) | |
constructor from Date and Time, UTC time is assumed More... | |
DateTime (const Date &date, const Time &timeFromDate, double utcOffset) | |
constructor from Date and Time and UTC Offset More... | |
DateTime (const DateTime &other) | |
copy constructor More... | |
DateTime (const std::string &string) | |
constructor from simple string format, UTC time is assumed More... | |
DateTime (tm t_tm) | |
from system tm struct More... | |
bool | operator!= (const DateTime &other) const |
non-equality operator More... | |
DateTime | operator+ (const Time &time) const |
addition operator More... | |
DateTime & | operator+= (const Time &time) |
assignment by addition operator More... | |
DateTime | operator- (const Time &time) const |
difference operator More... | |
Time | operator- (const DateTime &dateTime) const |
time duration More... | |
Time | operator- (const Date &date) const |
time duration More... | |
DateTime & | operator-= (const Time &time) |
assignment by difference operator More... | |
bool | operator< (const DateTime &rhs) const |
less than operator More... | |
bool | operator<= (const DateTime &rhs) const |
less than equals operator More... | |
DateTime & | operator= (const DateTime &other) |
assignment operator More... | |
bool | operator== (const DateTime &other) const |
equality operator More... | |
bool | operator> (const DateTime &rhs) const |
greater than operator More... | |
bool | operator>= (const DateTime &rhs) const |
greater than equals operator More... | |
Time | time () const |
getter to time member More... | |
time_t | toEpoch () const |
convert to epoch time_t in UTC time More... | |
std::string | toISO8601 () const |
convert to ISO 8601 string More... | |
std::string | toString () const |
convert to simple string format in UTC More... | |
double | utcOffset () const |
UTC offset in hours, local time = UTC time + UTC offset. More... | |
Static Public Member Functions | |
static DateTime | fromEpoch (const std::time_t &time) |
construct from epoch time_t in UTC More... | |
static boost::optional< DateTime > | fromISO8601 (const std::string &str) |
construct from ISO 8601 string More... | |
static double | localOffsetUTC () |
get the current UTC offset More... | |
static openstudio::LogChannel | logChannel () |
static DateTime | now () |
get the local time now More... | |
static DateTime | nowUTC () |
get the UTC time now More... | |
DateTime is an absolute unit of time, resolution to the second date is a valid Date time is normalized to 0 <= time < 24 hrs.
openstudio::DateTime::DateTime | ( | ) |
default constructor, UTC time is assumed
openstudio::DateTime::DateTime | ( | const DateTime & | other | ) |
copy constructor
openstudio::DateTime::DateTime | ( | const std::string & | string | ) |
constructor from simple string format, UTC time is assumed
openstudio::DateTime::DateTime | ( | tm | t_tm | ) |
from system tm struct
Date openstudio::DateTime::date | ( | ) | const |
getter to date member
|
static |
construct from epoch time_t in UTC
|
static |
construct from ISO 8601 string
|
static |
get the current UTC offset
|
inlinestatic |
|
static |
get the local time now
|
static |
get the UTC time now
bool openstudio::DateTime::operator!= | ( | const DateTime & | other | ) | const |
non-equality operator
bool openstudio::DateTime::operator< | ( | const DateTime & | rhs | ) | const |
less than operator
bool openstudio::DateTime::operator<= | ( | const DateTime & | rhs | ) | const |
less than equals operator
bool openstudio::DateTime::operator== | ( | const DateTime & | other | ) | const |
equality operator
bool openstudio::DateTime::operator> | ( | const DateTime & | rhs | ) | const |
greater than operator
bool openstudio::DateTime::operator>= | ( | const DateTime & | rhs | ) | const |
greater than equals operator
Time openstudio::DateTime::time | ( | ) | const |
getter to time member
time_t openstudio::DateTime::toEpoch | ( | ) | const |
convert to epoch time_t in UTC time
std::string openstudio::DateTime::toISO8601 | ( | ) | const |
convert to ISO 8601 string
std::string openstudio::DateTime::toString | ( | ) | const |
convert to simple string format in UTC
double openstudio::DateTime::utcOffset | ( | ) | const |
UTC offset in hours, local time = UTC time + UTC offset.