45 #include <QtCore/qstring.h> 46 #include <QtCore/qnamespace.h> 47 #include <QtCore/qsharedpointer.h> 64 QDate(
int y,
int m,
int d);
66 bool isNull()
const {
return jd == 0; }
72 int dayOfWeek()
const;
73 int dayOfYear()
const;
74 int daysInMonth()
const;
75 int daysInYear()
const;
76 int weekNumber(
int *yearNum = 0)
const;
78 #ifndef QT_NO_TEXTDATE 80 static QT3_SUPPORT
QString monthName(
int month) {
return shortMonthName(month); }
81 static QT3_SUPPORT
QString dayName(
int weekday) {
return shortDayName(weekday); }
84 static QString shortMonthName(
int month);
86 static QString shortDayName(
int weekday);
88 static QString longMonthName(
int month);
90 static QString longDayName(
int weekday);
92 #endif // QT_NO_TEXTDATE 93 #ifndef QT_NO_DATESTRING 97 bool setYMD(
int y,
int m,
int d);
98 bool setDate(
int year,
int month,
int day);
100 void getDate(
int *year,
int *month,
int *day);
102 QDate addDays(
int days)
const;
103 QDate addMonths(
int months)
const;
104 QDate addYears(
int years)
const;
105 int daysTo(
const QDate &)
const;
109 bool operator<(
const QDate &other)
const {
return jd < other.
jd; }
111 bool operator>(
const QDate &other)
const {
return jd > other.
jd; }
114 static QDate currentDate();
115 #ifndef QT_NO_DATESTRING 119 static bool isValid(
int y,
int m,
int d);
120 static bool isLeapYear(
int year);
122 inline static QT3_SUPPORT
bool leapYear(
int year) {
return isLeapYear(year); }
126 static uint gregorianToJulian(
int y,
int m,
int d);
127 static void julianToGregorian(
uint jd,
int &y,
int &m,
int &d);
130 static QT3_SUPPORT QDate currentDate(
Qt::TimeSpec spec);
141 #ifndef QT_NO_DATASTREAM 152 #
if defined(Q_OS_WINCE)
153 , startTick(NullTime)
156 QTime(
int h,
int m,
int s = 0,
int ms = 0);
158 bool isNull()
const {
return mds == NullTime; }
159 bool isValid()
const;
165 #ifndef QT_NO_DATESTRING 169 bool setHMS(
int h,
int m,
int s,
int ms = 0);
171 QTime addSecs(
int secs)
const;
172 int secsTo(
const QTime &)
const;
173 QTime addMSecs(
int ms)
const;
174 int msecsTo(
const QTime &)
const;
183 static QTime currentTime();
184 #ifndef QT_NO_DATESTRING 188 static bool isValid(
int h,
int m,
int s,
int ms = 0);
199 inline int ds()
const {
return mds == -1 ? 0 : mds; }
201 #if defined(Q_OS_WINCE) 207 #ifndef QT_NO_DATASTREAM 228 bool isValid()
const;
233 qint64 toMSecsSinceEpoch()
const;
234 uint toTime_t()
const;
235 void setDate(
const QDate &date);
236 void setTime(
const QTime &time);
238 void setMSecsSinceEpoch(
qint64 msecs);
239 void setTime_t(
uint secsSince1Jan1970UTC);
240 #ifndef QT_NO_DATESTRING 263 void setUtcOffset(
int seconds);
264 int utcOffset()
const;
268 #ifndef QT_NO_DATESTRING 274 static qint64 currentMSecsSinceEpoch();
277 inline QT3_SUPPORT
void setTime_t(
uint secsSince1Jan1970UTC,
Qt::TimeSpec spec) {
278 setTime_t(secsSince1Jan1970UTC);
284 return currentDateTime();
286 return currentDateTime().
toUTC();
296 #ifndef QT_NO_DATASTREAM 307 return currentDate();
315 return currentTime();
321 #ifndef QT_NO_DATASTREAM 328 #endif // QT_NO_DATASTREAM 330 #if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING) 340 #endif // QDATETIME_H The QDebug class provides an output stream for debugging information.
bool operator<(const QTime &other) const
Returns true if this time is earlier than t; otherwise returns false.
bool operator<=(const QTime &other) const
Returns true if this time is earlier than or equal to t; otherwise returns false. ...
bool operator<=(const QDateTime &other) const
Returns true if this datetime is earlier than or equal to the other datetime; otherwise returns false...
static double elapsed(qint64 after, qint64 before)
#define QT_END_NAMESPACE
This macro expands to.
bool isNull() const
Returns true if the date is null; otherwise returns false.
bool operator!=(const QDateTime &other) const
Returns true if this datetime is different from the other datetime; otherwise returns false...
bool isNull() const
Returns true if the time is null (i.
bool operator==(const QTime &other) const
Returns true if this time is equal to t; otherwise returns false.
bool operator>=(const QDate &other) const
Returns true if this date is later than or equal to d; otherwise returns false.
bool operator!=(const QDate &other) const
Returns true if this date is different from d; otherwise returns false.
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QDate &)
The QDate class provides date functions.
bool operator>=(const QDateTime &other) const
Returns true if this datetime is later than or equal to the other datetime; otherwise returns false...
QDate()
Constructs a null date.
The QString class provides a Unicode character string.
static QDate fromJulianDay(int jd)
Converts the Julian day jd to a QDate.
bool operator<(int priority, const QPair< QRunnable *, int > &p)
MonthNameType
This enum describes the types of the string representation used for the month name.
bool operator>=(const QTime &other) const
Returns true if this time is later than or equal to t; otherwise returns false.
static QString toString(Register *reg, int type, bool *ok=0)
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static QDate currentDate()
Returns the current date, as reported by the system clock.
QDateTime toLocalTime() const
Returns a datetime containing the date and time information in this datetime, but specified using the...
QTime()
Constructs a null time object.
bool operator>(const QTime &other) const
Returns true if this time is later than t; otherwise returns false.
Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE)
bool operator>(const QDateTime &other) const
Returns true if this datetime is later than the other datetime; otherwise returns false...
QDateTime toUTC() const
Returns a datetime containing the date and time information in this datetime, but specified using the...
bool operator!=(const QTime &other) const
Returns true if this time is different from t; otherwise returns false.
bool operator<=(const QDate &other) const
Returns true if this date is earlier than or equal to d; otherwise returns false. ...
QDate date() const
Returns the date part of the datetime.
int toJulianDay() const
Converts the date to a Julian day.
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QDate &)
The QDateTime class provides date and time functions.
static QTime currentTime()
Returns the current time as reported by the system clock.
bool operator<(const QDate &other) const
Returns true if this date is earlier than d; otherwise returns false.
if(void) toggleToolbarShown
static QDateTime currentDateTime()
Returns the current datetime, as reported by the system clock, in the local time zone.
bool operator==(const QDate &other) const
Returns true if this date is equal to d; otherwise returns false.
static const char months[]
QExplicitlySharedDataPointer< QDateTimePrivate > d
QTime time() const
Returns the time part of the datetime.
The QDataStream class provides serialization of binary data to a QIODevice.
QDataStream & operator<<(QDataStream &out, const QUrl &url)
Writes url url to the stream out and returns a reference to the stream.
bool operator==(QBool b1, bool b2)
bool operator>(const QDate &other) const
Returns true if this date is later than d; otherwise returns false.
static bool isNull(const QVariant::Private *d)
QDataStream & operator>>(QDataStream &in, QUrl &url)
Reads a url into url from the stream in and returns a reference to the stream.