22 #include <tdeglobal.h>
23 #include <tdelocale.h>
27 TQTime DateTime::mStartOfDay;
31 return mDateOnly ? mStartOfDay : mDateTime.time();
36 return mDateOnly ? TQDateTime(mDateTime.date(), mStartOfDay) : mDateTime;
42 return TDEGlobal::locale()->formatDate(mDateTime.date(), shortFormat);
44 return TDEGlobal::locale()->formatDateTime(mDateTime, shortFormat);
51 if (dt1.mDateTime.date() != dt2.mDateTime.date())
53 if (dt1.mDateOnly && dt2.mDateOnly)
55 if (!dt1.mDateOnly && !dt2.mDateOnly)
57 bool valid1 = dt1.mTimeValid && dt1.mDateTime.time().isValid();
58 bool valid2 = dt2.mTimeValid && dt2.mDateTime.time().isValid();
59 if (!valid1 && !valid2)
61 if (!valid1 || !valid2)
63 return dt1.mDateTime.time() == dt2.mDateTime.time();
70 if (dt1.mDateTime.date() != dt2.mDateTime.date())
71 return dt1.mDateTime.date() < dt2.mDateTime.date();
72 if (dt1.mDateOnly && dt2.mDateOnly)
74 if (!dt1.mDateOnly && !dt2.mDateOnly)
75 return dt1.mDateTime.time() < dt2.mDateTime.time();
78 return t < dt2.mDateTime.time();
79 return dt1.mDateTime.time() < t;
A TQDateTime with date-only option.
static TQTime startOfDay()
Returns the start-of-day time.
TQDateTime dateTime() const
Returns the date and time of the value.
TQString formatLocale(bool shortFormat=true) const
Returns the value as a string, formatted according to the user's locale.
TQTime time() const
Returns the time part of the value.