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);
85 static QString shortMonthName(
int month, MonthNameType
type);
86 static QString shortDayName(
int weekday);
87 static QString shortDayName(
int weekday, MonthNameType
type);
88 static QString longMonthName(
int month);
89 static QString longMonthName(
int month, MonthNameType
type);
90 static QString longDayName(
int weekday);
91 static QString longDayName(
int weekday, MonthNameType
type);
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;
107 bool operator==(
const QDate &other)
const {
return jd == other.jd; }
108 bool operator!=(
const QDate &other)
const {
return jd != other.jd; }
109 bool operator<(
const QDate &other)
const {
return jd < other.jd; }
110 bool operator<=(
const QDate &other)
const {
return jd <= other.jd; }
111 bool operator>(
const QDate &other)
const {
return jd > other.jd; }
112 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);
140 friend class QDateTimePrivate;
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);
198 enum TimeFlag { NullTime = -1 };
199 inline int ds()
const {
return mds == -1 ? 0 : mds; }
201 #if defined(Q_OS_WINCE)
206 friend class QDateTimePrivate;
207 #ifndef QT_NO_DATASTREAM
214 class QDateTimePrivate;
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
272 static QDateTime fromTime_t(uint secsSince1Jan1970UTC);
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();
292 friend class QDateTimePrivate;
296 #ifndef QT_NO_DATASTREAM
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
GLuint GLuint GLsizei GLenum type
bool operator==(const QTime &other) const
bool operator<(const QDate &other) const
QDateTime toLocalTime() const
bool operator>(const QTime &other) const
bool operator<=(const QDateTime &other) const
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QDate &)
bool operator>(const QDate &other) const
bool operator!=(const QTime &other) const
bool operator<(const QTime &other) const
static QTime currentTime()
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
#define QT_BEGIN_NAMESPACE
bool operator!=(const QDate &other) const
GLenum GLsizei GLenum format
Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE)
static QDate currentDate()
bool operator>=(const QDateTime &other) const
bool operator>(const QDateTime &other) const
bool operator>=(const QTime &other) const
bool operator>=(const QDate &other) const
bool operator<=(const QDate &other) const
bool operator<=(const QTime &other) const
static QDateTime currentDateTime()
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QDate &)
int int int int int int h
bool operator!=(const QDateTime &other) const
static QDate fromJulianDay(int jd)
bool operator<(const QByteArray &a1, const QByteArray &a2)
bool operator==(const QDate &other) const