datetime.h
62 { mDateTime = dt.mDateTime; mDateOnly = dt.mDateOnly; mTimeValid = dt.mTimeValid; return *this; }
74 bool isNull() const { return mDateTime.date().isNull() && (mDateOnly || mDateTime.time().isNull()); }
76 bool isValid() const { return mDateTime.date().isValid() && (mDateOnly || (mTimeValid && mDateTime.time().isValid())); }
155 { return (mDateOnly || dt.mDateOnly) ? mDateTime.date().daysTo(dt.date()) : mDateTime.daysTo(dt.mDateTime); }
161 { return (mDateOnly || dt.mDateOnly) ? mDateTime.date().daysTo(dt.date()) * 24*60 : mDateTime.secsTo(dt.mDateTime) / 60; }
167 { return (mDateOnly || dt.mDateOnly) ? mDateTime.date().daysTo(dt.date()) * 24*3600 : mDateTime.secsTo(dt.mDateTime); }
224 inline bool operator!=(const DateTime& dt1, const DateTime& dt2) { return !operator==(dt1, dt2); }
234 inline bool operator>=(const DateTime& dt1, const DateTime& dt2) { return !operator<(dt1, dt2); }
239 inline bool operator<=(const DateTime& dt1, const DateTime& dt2) { return !operator<(dt2, dt1); }
friend bool operator<(const DateTime &dt1, const DateTime &dt2)
Returns true if the dt1 is earlier than dt2.
Definition: datetime.cpp:68
bool isValid() const
Returns true if the date is valid and, if it is a date-time value, the time is also valid.
Definition: datetime.h:76
void set(const TQDateTime &dt, bool dateOnly=false)
Sets a date-time or date-only value.
Definition: datetime.h:105
bool isNull() const
Returns true if the date is null and, if it is a date-time value, the time is also null.
Definition: datetime.h:74
DateTime addMins(int n) const
Returns a DateTime value mins minutes later than the value of this object.
Definition: datetime.h:140
void setDateOnly(bool d)
Sets the value to be either date-only or date-time.
Definition: datetime.h:82
DateTime addMonths(int n) const
Returns a DateTime value n months later than the value of this object.
Definition: datetime.h:150
int daysTo(const DateTime &dt) const
Returns the number of days from this date or date-time to dt.
Definition: datetime.h:154
TQString formatLocale(bool shortFormat=true) const
Returns the value as a string, formatted according to the user's locale.
Definition: datetime.cpp:39
DateTime(const TQDateTime &dt, bool dateOnly=false)
Constructor for a date-time or date-only value.
Definition: datetime.h:55
DateTime addDays(int n) const
Returns a DateTime value n days later than the value of this object.
Definition: datetime.h:148
int minsTo(const DateTime &dt) const
Returns the number of minutes from this date or date-time to dt.
Definition: datetime.h:160
int secsTo(const DateTime &dt) const
Returns the number of seconds from this date or date-time to dt.
Definition: datetime.h:166
DateTime addSecs(int n) const
Returns a DateTime value secs seconds later than the value of this object.
Definition: datetime.h:129
DateTime(const TQDate &d, const TQTime &t)
Constructor for a date-time value.
Definition: datetime.h:49
TQString toString(const TQString &format) const
Returns the value as a string.
Definition: datetime.h:185
friend bool operator==(const DateTime &dt1, const DateTime &dt2)
Returns true if the two values are equal.
Definition: datetime.cpp:49
TQString toString(TQt::DateFormat f=TQt::TextDate) const
Returns the value as a string.
Definition: datetime.h:172
DateTime addYears(int n) const
Returns a DateTime value n years later than the value of this object.
Definition: datetime.h:152