Combination of date and time information. More...
#include <Radiant/DateTime.hpp>
Public Types | |
| enum | DateFormat { DATE_TIME_ISO, DATE_ISO } |
| Format for date & time. More... | |
Public Member Functions | |
| TimeStamp | asTimeStamp () const |
| Return the date and time as a TimeStamp. More... | |
| void | clearTime () |
| Reset the hour, minute and second values to zero. | |
| DateTime () | |
| Constructor. | |
| DateTime (const TimeStamp &ts) | |
| Constructs an object from time stamp. More... | |
| int | daysInMonth () |
| Returns the number of days in the current month. More... | |
| bool | fromString (const QString &s, DateFormat format=DATE_ISO) |
| Read time and date from a string. More... | |
| int | hour () const |
| Hour since midnight (0-23) More... | |
| int | microSecond () const |
| Microseconds since last full second (0-999999) More... | |
| int | milliSecond () const |
| Milliseconds since last full second (0-999) More... | |
| int | minute () const |
| Minutes since last full hour (0-59) More... | |
| int | month () const |
| Month of year (January = 0) More... | |
| int | monthDay () const |
| Day of month (0-30) More... | |
| void | print (char *buf, bool isotime=false) |
| Print the date-time information to a string. More... | |
| int | second () const |
| Seconds since last full minute (0-59) More... | |
| void | setHour (int hour) |
| Set the hour. More... | |
| void | setMinute (int minute) |
| Set the minute. More... | |
| void | setMonth (int month) |
| Set the month. More... | |
| void | setMonthDay (int monthDay) |
| Set the day of the month. More... | |
| void | setSecond (int second) |
| Set the second. More... | |
| void | setWeekDay (int weekDay) |
| Set the day of the week. More... | |
| void | setYear (int year) |
| Set the year. More... | |
| void | toNextMonth () |
| Advance time to next month. | |
| void | toNextMonthDay () |
| Advance time to next day of the month. | |
| void | toNextYear () |
| Advance time to next year. | |
| int | weekDay () const |
| Day of week (Sunday = 0) More... | |
| int | year () const |
| Year (anno domini) More... | |
| ~DateTime () | |
| Destructor. | |
Static Public Member Functions | |
| static int | daysInMonth (int month, int year) |
| Returns the number of days in the month. More... | |
Combination of date and time information.
| Radiant::DateTime::DateTime | ( | const TimeStamp & | ts | ) |
Constructs an object from time stamp.
| ts | TimeStamp to convert |
| TimeStamp Radiant::DateTime::asTimeStamp | ( | ) | const |
Return the date and time as a TimeStamp.
|
static |
Returns the number of days in the month.
This function does take the leap years into account, so the length of Febuary changes between 28 and 29 days, depending on the year.
| month | month [0-11] |
| year | year number |
| int Radiant::DateTime::daysInMonth | ( | ) |
Returns the number of days in the current month.
This method takes the leap-years into account.
| bool Radiant::DateTime::fromString | ( | const QString & | s, |
| DateFormat | format = DATE_ISO |
||
| ) |
Read time and date from a string.
| s | String to parse |
| format | Format of the date |
|
inline |
|
inline |
Microseconds since last full second (0-999999)
|
inline |
Milliseconds since last full second (0-999)
|
inline |
|
inline |
|
inline |
| void Radiant::DateTime::print | ( | char * | buf, |
| bool | isotime = false |
||
| ) |
Print the date-time information to a string.
| [out] | buf | buffer to write to |
| isotime | use ISO time format |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |