DateTime

DateTime class.
Note: milliseconds default to 0 due to limited accuracy.

Type: Value type

Methods

Declaration Description
void DateTime() Default constructor.
void DateTime(uint uiMilliseconds, int iSeconds, int iMinutes, int iHour, int iDayOfMonth, int iMonth, int iYear) Init constructor.
void DateTime(time_t time) Unix timestamp constructor.
void DateTime(const DateTime& in ref) Copy constructor.
DateTime& opAssign(const DateTime& in ref) Assignment operator.
DateTime& opAssign(time_t time) Assignment operator.
time_t ToUnixTimestamp() const Get time as a unix timestamp.
void SetUnixTimestamp(time_t time) Sets time as a unix timestamp.
uint GetMilliseconds() const Get milliseconds.
int GetSeconds() const Get seconds after the minute including leap second (0-60).
int GetMinutes() const Get minutes after the hour (0-59).
int GetHour() const Get hours since midnight (0-23).
int GetDayOfMonth() const Get day of the month (1-31).
int GetMonth() const Get month of the year (1-12).
int GetYear() const Get year.
int GetIsDst() const Get daylight savings active.
void SetMilliseconds(uint uiMilliseconds) Set milliseconds.
void SetSeconds(int iSeconds) Set seconds after the minute including leap second (0-60).
void SetMinutes(int iMinutes) Set minutes after the hour (0-59).
void SetHour(int iHours) Set hours since midnight (0-23).
void SetDayOfMonth(int iDay) Set day of the month (1-31).
void SetMonth(int iMonth) Set month of the year (1-12).
void SetYear(int iYear) Set year.
void SetIsDst(int iIsDst) Set daylight savings active.
int Format(string& out szResult, const string& in szFormat) const Formats this datetime as a string.
Returns the length of the destination string, or 0 if the buffer was not large enough.
void ToString(string& out szResult) const Returns a string representation of this datetime.
bool opEquals(const DateTime& in other) const Returns whether these two DateTimes represent the same time.
int opCmp(const DateTime& in other) const Comparison operator.
TimeDifference opSub(const DateTime& in other) const Subtracts the given DateTime from this one, resulting in a TimeDifference object.
DateTime& opAddAssign(const TimeDifference& in diffTime) Adds the given TimeDifference to this one.
DateTime opAdd(const TimeDifference& in diffTime) const Adds this DateTime and the given TimeDifferene together, returning a copy containing the new time.