MDAL
Classes | Public Types | Public Member Functions | List of all members
MDAL::DateTime Class Reference

Public Types

enum  Calendar { Gregorian = 0 , ProlepticGregorian , Julian }
 
enum  Epoch { Unix = 0 , JulianDay }
 

Public Member Functions

 DateTime (int year, int month, int day, int hours=0, int minutes=0, double seconds=0, Calendar calendar=Gregorian)
 Constructor with date/time values and calendar type.
 
 DateTime (double value, Epoch epoch)
 Constructor with Julian day or Unix Epoch.
 
 DateTime (const std::string &fromISO8601)
 Constructor with ISO 8601 string.
 
std::string toStandardCalendarISO8601 () const
 Returns a string with the date/time expressed in Greogrian proleptic calendar with ISO8601 format (local time zone) Do not support negative year.
 
double toJulianDay () const
 Returns the Julian day value.
 
std::string toJulianDayString () const
 Returns the Julain day value expressed with a string.
 
std::vector< int > expandToCalendarArray () const
 Returns a array of int with {year,month,day,hours,minutes,seconds} with standard calendar format.
 
RelativeTimestamp operator- (const DateTime &other) const
 operators
 
DateTime operator+ (const RelativeTimestamp &duration) const
 
DateTime operator- (const RelativeTimestamp &duration) const
 
bool operator== (const DateTime &other) const
 
bool operator< (const DateTime &other) const
 
bool isValid () const
 

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