DateTime Class Reference
The DateTime class holds a date, with or without a time. QDateTime with date-only option. More...
#include <datetime.h>
Public Member Functions
- DateTime ()
- DateTime (const QDate &d)
- DateTime (const QDate &d, const QTime &t)
- DateTime (const QDateTime &dt, bool dateOnly=false)
- DateTime & operator= (const DateTime &dt)
- DateTime & operator= (const QDateTime &dt)
- DateTime & operator= (const QDate &d)
- bool isNull () const
- bool isValid () const
- bool isDateOnly () const
- void setDateOnly (bool d)
- QDate date () const
- QTime time () const
- QDateTime dateTime () const
- void set (const QDateTime &dt, bool dateOnly=false)
- void set (const QDate &d, const QTime &t)
- void setTime (const QTime &t)
- void setTime_t (uint secs)
- DateTime addSecs (int n) const
- DateTime addMins (int n) const
- DateTime addDays (int n) const
- DateTime addMonths (int n) const
- DateTime addYears (int n) const
- int daysTo (const DateTime &dt) const
- int minsTo (const DateTime &dt) const
- int secsTo (const DateTime &dt) const
- QString toString (Qt::DateFormat f=Qt::TextDate) const
- QString toString (const QString &format) const
- QString formatLocale (bool shortFormat=true) const
Friends
- bool operator== (const DateTime &dt1, const DateTime &dt2)
- bool operator< (const DateTime &dt1, const DateTime &dt2)
Detailed Description
The DateTime class holds a date, with or without a time. QDateTime with date-only option.DateTime is very similar to the QDateTime class, with the additional option to hold a date-only value. This allows a single date-time representation to be used for both an event having a specific date and time, and an all-day event.
- Author:
- David Jarvie <software@astrojar.org.uk>
Constructor & Destructor Documentation
|
Default constructor. Constructs a null date-time. |
|
Constructor for a date-only value.
|
|
Constructor for a date-time value.
|
|
Constructor for a date-time or date-only value.
|
Member Function Documentation
|
Assignment operator. Sets the value to a specified date-time or date-only value. |
|
Assignment operator. Sets the value to a specified date-time. |
|
Assignment operator. Sets the value to a specified date-only value. |
|
Returns true if the date is null and, if it is a date-time value, the time is also null.
|
|
Returns true if the date is valid and, if it is a date-time value, the time is also valid.
|
|
Returns true if it is date-only value.
|
|
Sets the value to be either date-only or date-time.
|
|
Returns the date part of the value.
|
|
Returns the time part of the value. If the value is date-only, the time returned is the start-of-day time set in the Preferences dialogue. |
|
Returns the date and time of the value. If the value is date-only, the time part returned is equal to the start-of-day time set in the KAlarm Preferences dialogue. |
|
Sets a date-time or date-only value.
|
|
Sets a date-time value.
|
|
Sets the time component of the value. The value is converted if necessary to be a date-time value. |
|
Sets the value to a specified date-time value.
|
|
Returns a DateTime value
If this object is date-only, |
|
Returns a DateTime value
If this object is date-only, |
|
Returns a DateTime value
|
|
Returns a DateTime value
|
|
Returns a DateTime value
|
|
Returns the number of days from this date or date-time to
|
|
Returns the number of minutes from this date or date-time to If either of the values is date-only, the result is calculated by simply taking the difference in dates and ignoring the times. |
|
Returns the number of seconds from this date or date-time to If either of the values is date-only, the result is calculated by simply taking the difference in dates and ignoring the times. |
|
Returns the value as a string. If it is a date-time, both time and date are included in the output. If it is date-only, only the date is included in the output. |
|
Returns the value as a string. If it is a date-time, both time and date are included in the output. If it is date-only, only the date is included in the output. |
|
Returns the value as a string, formatted according to the user's locale. If it is a date-time, both time and date are included in the output. If it is date-only, only the date is included in the output. |
Friends And Related Function Documentation
|
Returns true if the two values are equal.
|
|
Returns true if the If the two values have the same date, and one value is date-only while the other is a date-time, the time used for the date-only value is the start-of-day time set in the KAlarm Preferences dialogue. |
The documentation for this class was generated from the following files:
- datetime.h
- datetime.cpp