1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.core.datetime;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.calendar;
19 import qt.core.global;
20 import qt.core.metatype;
21 import qt.core.namespace;
22 import qt.core.string;
23 import qt.core.stringview;
24 import qt.core.timezone;
25 import qt.core.typeinfo;
26 import qt.helpers;
27 
28 /+ #if defined(Q_OS_DARWIN) || defined(Q_QDOC)
29 Q_FORWARD_DECLARE_CF_TYPE(CFDate);
30 Q_FORWARD_DECLARE_OBJC_CLASS(NSDate);
31 #endif
32 
33 
34 class QCalendar;
35 #if QT_CONFIG(timezone)
36 class QTimeZone;
37 #endif
38 class QDateTime; +/
39 
40 @Q_MOVABLE_TYPE @(QMetaType.Type.QDate) extern(C++, class) struct /+ Q_CORE_EXPORT +/ QDate // ### Qt 6: change to be used by value, not const &
41 {
42 public:
43     enum MonthNameType { // ### Qt 6: remove, along with methods using it
44         DateFormat = 0,
45         StandaloneFormat
46     }
47 private:
48     /+ explicit +/ this(qint64 julianDay)
49     {
50         this.jd = julianDay;
51     }
52 public:
53     /+this()
54     {
55         this.jd = nullJd();
56     }+/
57     this(int y, int m, int d);
58     this(int y, int m, int d, QCalendar cal);
59 
60     bool isNull() const { return !isValid(); }
61     bool isValid() const { return jd >= minJd() && jd <= maxJd(); }
62 
63     int year() const;
64     int month() const;
65     int day() const;
66     int dayOfWeek() const;
67     int dayOfYear() const;
68     int daysInMonth() const;
69     int daysInYear() const;
70     int weekNumber(int* yearNum = null) const;
71 
72     int year(QCalendar cal) const;
73     int month(QCalendar cal) const;
74     int day(QCalendar cal) const;
75     int dayOfWeek(QCalendar cal) const;
76     int dayOfYear(QCalendar cal) const;
77     int daysInMonth(QCalendar cal) const;
78     int daysInYear(QCalendar cal) const;
79 
80     QDateTime startOfDay(/+ Qt:: +/qt.core.namespace.TimeSpec spec = /+ Qt:: +/qt.core.namespace.TimeSpec.LocalTime, int offsetSeconds = 0) const;
81     QDateTime endOfDay(/+ Qt:: +/qt.core.namespace.TimeSpec spec = /+ Qt:: +/qt.core.namespace.TimeSpec.LocalTime, int offsetSeconds = 0) const;
82 /+ #if QT_CONFIG(timezone) +/
83     QDateTime startOfDay(ref const(QTimeZone) zone) const;
84     QDateTime endOfDay(ref const(QTimeZone) zone) const;
85 /+ #endif
86 
87 #if QT_DEPRECATED_SINCE(5, 10) && QT_CONFIG(textdate) +/
88     /+ QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName") +/
89             static QString shortMonthName(int month, MonthNameType type = MonthNameType.DateFormat);
90     /+ QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName") +/
91             static QString shortDayName(int weekday, MonthNameType type = MonthNameType.DateFormat);
92     /+ QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName") +/
93             static QString longMonthName(int month, MonthNameType type = MonthNameType.DateFormat);
94     /+ QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName") +/
95             static QString longDayName(int weekday, MonthNameType type = MonthNameType.DateFormat);
96 /+ #endif // textdate && deprecated
97 #if QT_CONFIG(datestring) +/
98     QString toString(/+ Qt:: +/qt.core.namespace.DateFormat format = /+ Qt:: +/qt.core.namespace.DateFormat.TextDate) const;
99 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
100     // Only the deprecated locale-dependent formats use the calendar.
101     /+ QT_DEPRECATED_X("Use QLocale or omit the calendar") +/
102         QString toString(/+ Qt:: +/qt.core.namespace.DateFormat format, QCalendar cal) const;
103 /+ #endif
104 
105 #if QT_STRINGVIEW_LEVEL < 2 +/
106     static if(QT_STRINGVIEW_LEVEL < 2)
107     {
108         QString toString(ref const(QString) format) const;
109         QString toString(ref const(QString) format, QCalendar cal) const;
110     }
111 /+ #endif +/
112 
113     QString toString(QStringView format) const;
114     QString toString(QStringView format, QCalendar cal) const;
115 /+ #endif
116 #if QT_DEPRECATED_SINCE(5,0)
117     QT_DEPRECATED_X("Use setDate() instead") inline bool setYMD(int y, int m, int d)
118     { if (uint(y) <= 99) y += 1900; return setDate(y, m, d); }
119 #endif +/
120 
121     bool setDate(int year, int month, int day);
122     bool setDate(int year, int month, int day, QCalendar cal);
123 
124 /+ #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +/
125     void getDate(int* year, int* month, int* day); // ### Qt 6: remove
126 /+ #endif +/ // < Qt 6
127     void getDate(int* year, int* month, int* day) const;
128 
129     /+ Q_REQUIRED_RESULT +/ QDate addDays(qint64 days) const;
130     /+ Q_REQUIRED_RESULT +/ QDate addMonths(int months) const;
131     /+ Q_REQUIRED_RESULT +/ QDate addYears(int years) const;
132     /+ Q_REQUIRED_RESULT +/ QDate addMonths(int months, QCalendar cal) const;
133     /+ Q_REQUIRED_RESULT +/ QDate addYears(int years, QCalendar cal) const;
134     qint64 daysTo(ref const(QDate) ) const; // ### Qt 6: QDate
135 
136     /+bool operator ==(ref const(QDate) other) const { return jd == other.jd; }+/
137     /+bool operator !=(ref const(QDate) other) const { return jd != other.jd; }+/
138     /+bool operator < (ref const(QDate) other) const { return jd <  other.jd; }+/
139     /+bool operator <=(ref const(QDate) other) const { return jd <= other.jd; }+/
140     /+bool operator > (ref const(QDate) other) const { return jd >  other.jd; }+/
141     /+bool operator >=(ref const(QDate) other) const { return jd >= other.jd; }+/
142 
143     static QDate currentDate();
144 /+ #if QT_CONFIG(datestring) +/
145     static QDate fromString(ref const(QString) s, /+ Qt:: +/qt.core.namespace.DateFormat f = /+ Qt:: +/qt.core.namespace.DateFormat.TextDate);
146     static QDate fromString(ref const(QString) s, ref const(QString) format);
147     static QDate fromString(ref const(QString) s, ref const(QString) format, QCalendar cal);
148 /+ #endif +/
149     static bool isValid(int y, int m, int d);
150     static bool isLeapYear(int year);
151 
152     pragma(inline, true) static QDate fromJulianDay(qint64 jd_)
153     { return jd_ >= minJd() && jd_ <= maxJd() ? QDate(jd_) : QDate() ; }
154     pragma(inline, true) qint64 toJulianDay() const { return jd; }
155 
156 private:
157     // using extra parentheses around min to avoid expanding it if it is a macro
158     pragma(inline, true) static qint64 nullJd() { return qint64.min; }
159     pragma(inline, true) static qint64 minJd() { return -784350574879L; }
160     pragma(inline, true) static qint64 maxJd() { return  784354017364L; }
161 
162     qint64 jd = nullJd();
163 
164     /+ friend class QDateTime; +/
165     /+ friend class QDateTimePrivate; +/
166     version(QT_NO_DATASTREAM){}else
167     {
168         /+ friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDate &); +/
169         /+ friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDate &); +/
170     }
171 }
172 /+ Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE); +/
173 
174 @Q_MOVABLE_TYPE @(QMetaType.Type.QTime) extern(C++, class) struct /+ Q_CORE_EXPORT +/ QTime // ### Qt 6: change to be used by value, not const &
175 {
176 private:
177     /+ explicit +/ this(int ms)
178     {
179         this.mds = ms;
180     }
181 public:
182     @disable this();
183     /+this()
184     {
185         this.mds = TimeFlag.NullTime;
186     }+/
187     this(int h, int m, int s = 0, int ms = 0);
188 
189     bool isNull() const { return mds == TimeFlag.NullTime; }
190     bool isValid() const;
191 
192     int hour() const;
193     int minute() const;
194     int second() const;
195     int msec() const;
196 /+ #if QT_CONFIG(datestring) +/
197     QString toString(/+ Qt:: +/qt.core.namespace.DateFormat f = /+ Qt:: +/qt.core.namespace.DateFormat.TextDate) const;
198     static if(QT_STRINGVIEW_LEVEL < 2)
199     {
200         QString toString(ref const(QString) format) const;
201     }
202     QString toString(QStringView format) const;
203 /+ #endif +/
204     bool setHMS(int h, int m, int s, int ms = 0);
205 
206     /+ Q_REQUIRED_RESULT +/ QTime addSecs(int secs) const;
207     int secsTo(ref const(QTime) ) const; // ### Qt 6: plain QTime
208     /+ Q_REQUIRED_RESULT +/ QTime addMSecs(int ms) const;
209     int msecsTo(ref const(QTime) ) const; // ### Qt 6: plain QTime
210 
211     /+bool operator ==(ref const(QTime) other) const { return mds == other.mds; }+/
212     /+bool operator !=(ref const(QTime) other) const { return mds != other.mds; }+/
213     /+bool operator < (ref const(QTime) other) const { return mds <  other.mds; }+/
214     /+bool operator <=(ref const(QTime) other) const { return mds <= other.mds; }+/
215     /+bool operator > (ref const(QTime) other) const { return mds >  other.mds; }+/
216     /+bool operator >=(ref const(QTime) other) const { return mds >= other.mds; }+/
217 
218     pragma(inline, true) static QTime fromMSecsSinceStartOfDay(int msecs) { return QTime(msecs); }
219     pragma(inline, true) int msecsSinceStartOfDay() const { return mds == TimeFlag.NullTime ? 0 : mds; }
220 
221     static QTime currentTime();
222 /+ #if QT_CONFIG(datestring) +/
223     static QTime fromString(ref const(QString) s, /+ Qt:: +/qt.core.namespace.DateFormat f = /+ Qt:: +/qt.core.namespace.DateFormat.TextDate);
224     static QTime fromString(ref const(QString) s, ref const(QString) format);
225 /+ #endif +/
226     static bool isValid(int h, int m, int s, int ms = 0);
227 
228 /+ #if QT_DEPRECATED_SINCE(5, 14) +/ // ### Qt 6: remove
229     /+ QT_DEPRECATED_X("Use QElapsedTimer instead") +/ void start();
230     /+ QT_DEPRECATED_X("Use QElapsedTimer instead") +/ int restart();
231     /+ QT_DEPRECATED_X("Use QElapsedTimer instead") +/ int elapsed() const;
232 /+ #endif +/
233 private:
234     enum TimeFlag { NullTime = -1 }
235     pragma(inline, true) int ds() const { return mds == -1 ? 0 : mds; }
236     int mds = TimeFlag.NullTime;
237 
238     /+ friend class QDateTime; +/
239     /+ friend class QDateTimePrivate; +/
240     version(QT_NO_DATASTREAM){}else
241     {
242         /+ friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QTime &); +/
243         /+ friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QTime &); +/
244     }
245 }
246 /+ Q_DECLARE_TYPEINFO(QTime, Q_MOVABLE_TYPE); +/
247 
248 extern(C++, class) struct QDateTimePrivate;
249 
250 @Q_MOVABLE_TYPE @(QMetaType.Type.QDateTime) extern(C++, class) struct /+ Q_CORE_EXPORT +/ QDateTime
251 {
252 private:
253     // ### Qt 6: revisit the optimization
254     struct ShortData {
255         size_t bitfieldData;
256 /+        version(LittleEndian)
257         {
258             /+ quintptr status : 8; +/
259             final quintptr status() const
260             {
261                 return (bitfieldData_status >> 0) & 0xff;
262             }
263             final uint status(uint value)
264             {
265                 bitfieldData_status = (bitfieldData_status & ~0xff) | ((value & 0xff) << 0);
266                 return value;
267             }
268         }
269         // note: this is only 24 bits on 32-bit systems...
270         /+ qintptr msecs : sizeof(void *) * 8 - 8; +/
271         final qintptr msecs() const
272         {
273             return (bitfieldData_msecs >> 0) & 0x1;
274         }
275         final uint msecs(uint value)
276         {
277             bitfieldData_status = (bitfieldData_status & ~0x100) | ((value & 0x1) << 8);
278             return value;
279         }
280 
281         version(BigEndian)
282         {
283             /+ quintptr status : 8; +/
284             final quintptr status() const
285             {
286                 return (bitfieldData_msecs >> 65) & 0xff;
287             }
288             final uint status(uint value)
289             {
290                 bitfieldData_msecs = (bitfieldData_msecs & ~0x1fe) | ((value & 0xff) << 65);
291                 return value;
292             }
293         }+/
294     }
295 
296     union Data {
297         enum {
298             // To be of any use, we need at least 60 years around 1970, which
299             // is 1,893,456,000,000 ms. That requires 41 bits to store, plus
300             // the sign bit. With the status byte, the minimum size is 50 bits.
301             CanBeSmall = ShortData.sizeof * 8 > 50
302         }
303 
304         //@disable this();
305         this(/+ Qt:: +/qt.core.namespace.TimeSpec);
306         /+ Data(const Data &other); +/
307         /+ Data(Data &&other); +/
308 //        ~this();
309 
310         bool isShort() const;
311         void detach();
312 
313         /+const(QDateTimePrivate)* operator ->() const;+/
314         /+QDateTimePrivate* operator ->();+/
315 
316         QDateTimePrivate* d;
317         ShortData data;
318     }
319 
320 public:
321     /+this() /+ noexcept(Data::CanBeSmall) +/ ;+/
322 
323 /+ #if QT_DEPRECATED_SINCE(5, 15) +/ // ### Qt 6: remove
324     /+ QT_DEPRECATED_X("Use QDate::startOfDay()") +/ /+ explicit +/this(ref const(QDate) );
325 /+ #endif +/
326     this(ref const(QDate) , ref const(QTime) , /+ Qt:: +/qt.core.namespace.TimeSpec spec = /+ Qt:: +/qt.core.namespace.TimeSpec.LocalTime);
327     // ### Qt 6: Merge with above with default offsetSeconds = 0
328     this(ref const(QDate) date, ref const(QTime) time, /+ Qt:: +/qt.core.namespace.TimeSpec spec, int offsetSeconds);
329 /+ #if QT_CONFIG(timezone) +/
330     this(ref const(QDate) date, ref const(QTime) time, ref const(QTimeZone) timeZone);
331 /+ #endif +/ // timezone
332     //@disable this(this);
333     //this(ref const(QDateTime) other)/+ noexcept+/;
334     /+ QDateTime(QDateTime &&other) noexcept; +/
335     ~this();
336 
337     /+ QDateTime &operator=(QDateTime &&other) noexcept { swap(other); return *this; } +/
338     /+ref QDateTime operator =(ref const(QDateTime) other)/+ noexcept+/;+/
339 
340     /+ void swap(QDateTime &other) noexcept { qSwap(d.d, other.d.d); } +/
341 
342     bool isNull() const;
343     bool isValid() const;
344 
345     QDate date() const;
346     QTime time() const;
347     /+ Qt:: +/qt.core.namespace.TimeSpec timeSpec() const;
348     int offsetFromUtc() const;
349 /+ #if QT_CONFIG(timezone) +/
350     QTimeZone timeZone() const;
351 /+ #endif +/ // timezone
352     QString timeZoneAbbreviation() const;
353     bool isDaylightTime() const;
354 
355     qint64 toMSecsSinceEpoch() const;
356     qint64 toSecsSinceEpoch() const;
357 
358     void setDate(ref const(QDate) date); // ### Qt 6: plain QDate
359     void setTime(ref const(QTime) time);
360     void setTimeSpec(/+ Qt:: +/qt.core.namespace.TimeSpec spec);
361     void setOffsetFromUtc(int offsetSeconds);
362 /+ #if QT_CONFIG(timezone) +/
363     void setTimeZone(ref const(QTimeZone) toZone);
364 /+ #endif +/ // timezone
365     void setMSecsSinceEpoch(qint64 msecs);
366     void setSecsSinceEpoch(qint64 secs);
367 
368 /+ #if QT_CONFIG(datestring) +/
369     QString toString(/+ Qt:: +/qt.core.namespace.DateFormat format = /+ Qt:: +/qt.core.namespace.DateFormat.TextDate) const;
370     static if(QT_STRINGVIEW_LEVEL < 2)
371     {
372         QString toString(ref const(QString) format) const;
373         QString toString(ref const(QString) format, QCalendar cal) const;
374     }
375     QString toString(QStringView format) const;
376     QString toString(QStringView format, QCalendar cal) const;
377 /+ #endif +/
378     /+ Q_REQUIRED_RESULT +/ QDateTime addDays(qint64 days) const;
379     /+ Q_REQUIRED_RESULT +/ QDateTime addMonths(int months) const;
380     /+ Q_REQUIRED_RESULT +/ QDateTime addYears(int years) const;
381     /+ Q_REQUIRED_RESULT +/ QDateTime addSecs(qint64 secs) const;
382     /+ Q_REQUIRED_RESULT +/ QDateTime addMSecs(qint64 msecs) const;
383 
384     QDateTime toTimeSpec(/+ Qt:: +/qt.core.namespace.TimeSpec spec) const;
385     pragma(inline, true) QDateTime toLocalTime() const { return toTimeSpec(/+ Qt:: +/qt.core.namespace.TimeSpec.LocalTime); }
386     pragma(inline, true) QDateTime toUTC() const { return toTimeSpec(/+ Qt:: +/qt.core.namespace.TimeSpec.UTC); }
387     QDateTime toOffsetFromUtc(int offsetSeconds) const;
388 /+ #if QT_CONFIG(timezone) +/
389     QDateTime toTimeZone(ref const(QTimeZone) toZone) const;
390 /+ #endif +/ // timezone
391 
392     qint64 daysTo(ref const(QDateTime) ) const;
393     qint64 secsTo(ref const(QDateTime) ) const;
394     qint64 msecsTo(ref const(QDateTime) ) const;
395 
396     /+bool operator ==(ref const(QDateTime) other) const;+/
397     /+pragma(inline, true) bool operator !=(ref const(QDateTime) other) const { return !(this == other); }+/
398     /+bool operator <(ref const(QDateTime) other) const;+/
399     /+pragma(inline, true) bool operator <=(ref const(QDateTime) other) const { return !(other < this); }+/
400     /+pragma(inline, true) bool operator >(ref const(QDateTime) other) const { return other < this; }+/
401     /+pragma(inline, true) bool operator >=(ref const(QDateTime) other) const { return !(this < other); }+/
402 
403 /+ #if QT_DEPRECATED_SINCE(5, 2) +/ // ### Qt 6: remove
404     /+ QT_DEPRECATED_X("Use setOffsetFromUtc() instead") +/ void setUtcOffset(int seconds);
405     /+ QT_DEPRECATED_X("Use offsetFromUtc() instead") +/ int utcOffset() const;
406 /+ #endif +/ // QT_DEPRECATED_SINCE
407 
408     static QDateTime currentDateTime();
409     static QDateTime currentDateTimeUtc();
410 /+ #if QT_CONFIG(datestring) +/
411     static QDateTime fromString(ref const(QString) s, /+ Qt:: +/qt.core.namespace.DateFormat f = /+ Qt:: +/qt.core.namespace.DateFormat.TextDate);
412     static QDateTime fromString(ref const(QString) s, ref const(QString) format);
413     static QDateTime fromString(ref const(QString) s, ref const(QString) format, QCalendar cal);
414 /+ #endif
415 
416 #if QT_DEPRECATED_SINCE(5, 8) +/
417     uint toTime_t() const;
418     void setTime_t(uint secsSince1Jan1970UTC);
419     static QDateTime fromTime_t(uint secsSince1Jan1970UTC);
420     static QDateTime fromTime_t(uint secsSince1Jan1970UTC, /+ Qt:: +/qt.core.namespace.TimeSpec spec,
421                                     int offsetFromUtc = 0);
422 /+ #  if QT_CONFIG(timezone) +/
423     static QDateTime fromTime_t(uint secsSince1Jan1970UTC, ref const(QTimeZone) timeZone);
424 /+ #  endif
425 #endif +/
426 
427     static QDateTime fromMSecsSinceEpoch(qint64 msecs);
428     // ### Qt 6: Merge with above with default spec = Qt::LocalTime
429     static QDateTime fromMSecsSinceEpoch(qint64 msecs, /+ Qt:: +/qt.core.namespace.TimeSpec spec, int offsetFromUtc = 0);
430     static QDateTime fromSecsSinceEpoch(qint64 secs, /+ Qt:: +/qt.core.namespace.TimeSpec spe = /+ Qt:: +/qt.core.namespace.TimeSpec.LocalTime, int offsetFromUtc = 0);
431 
432 /+ #if QT_CONFIG(timezone) +/
433     static QDateTime fromMSecsSinceEpoch(qint64 msecs, ref const(QTimeZone) timeZone);
434     static QDateTime fromSecsSinceEpoch(qint64 secs, ref const(QTimeZone) timeZone);
435 /+ #endif +/
436 
437     static qint64 currentMSecsSinceEpoch()/+ noexcept+/;
438     static qint64 currentSecsSinceEpoch()/+ noexcept+/;
439 
440     static if((versionIsSet!("OSX") || versionIsSet!("iOS") || versionIsSet!("TVOS") || versionIsSet!("WatchOS")))
441     {
442         /+ static QDateTime fromCFDate(CFDateRef date); +/
443         /+ CFDateRef toCFDate() const Q_DECL_CF_RETURNS_RETAINED; +/
444         /+ static QDateTime fromNSDate(const NSDate *date); +/
445         /+ NSDate *toNSDate() const Q_DECL_NS_RETURNS_AUTORELEASED; +/
446     }
447 
448     // (1<<63) ms is 292277024.6 (average Gregorian) years, counted from the start of 1970, so
449     // Last is floor(1970 + 292277024.6); no year 0, so First is floor(1970 - 1 - 292277024.6)
450     enum /+ class +/ YearRange : qint32 { First = -292275056,  Last = +292278994 }
451 
452 private:
453     /+ friend class QDateTimePrivate; +/
454 
455     Data d;
456 
457 /+ #ifndef QT_NO_DATASTREAM +/
458     version(QT_NO_DATASTREAM){}else
459     {
460         /+ friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &); +/
461         /+ friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &); +/
462     }
463 /+ #endif
464 
465 #if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
466     friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
467 #endif +/
468 }
469 /+ Q_DECLARE_SHARED(QDateTime)
470 
471 #ifndef QT_NO_DATASTREAM
472 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDate &);
473 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDate &);
474 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QTime &);
475 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QTime &);
476 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
477 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
478 #endif // QT_NO_DATASTREAM
479 
480 #if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
481 Q_CORE_EXPORT QDebug operator<<(QDebug, const QDate &);
482 Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &);
483 Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
484 #endif
485 
486 // QDateTime is not noexcept for now -- to be revised once
487 // timezone and calendaring support is added
488 Q_CORE_EXPORT uint qHash(const QDateTime &key, uint seed = 0);
489 Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0) noexcept;
490 Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0) noexcept; +/
491