summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qdatetime_p.h')
-rw-r--r--src/corelib/tools/qdatetime_p.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h
index 7fd36bc4e0..f52108d764 100644
--- a/src/corelib/tools/qdatetime_p.h
+++ b/src/corelib/tools/qdatetime_p.h
@@ -57,6 +57,8 @@
#include "QtCore/qatomic.h"
#include "QtCore/qdatetime.h"
+#include "qtimezone.h"
+
QT_BEGIN_NAMESPACE
class QDateTimePrivate : public QSharedData
@@ -69,7 +71,8 @@ public:
LocalStandard = 0,
LocalDST = 1,
UTC = 2,
- OffsetFromUTC = 3
+ OffsetFromUTC = 3,
+ TimeZone = 4
};
// Daylight Time Status
@@ -86,7 +89,8 @@ public:
NullTime = 0x02,
ValidDate = 0x04,
ValidTime = 0x08,
- ValidDateTime = 0x10
+ ValidDateTime = 0x10,
+ TimeZoneCached = 0x20
};
Q_DECLARE_FLAGS(StatusFlags, StatusFlag)
@@ -99,16 +103,26 @@ public:
QDateTimePrivate(const QDate &toDate, const QTime &toTime, Qt::TimeSpec toSpec,
int offsetSeconds);
+#ifndef QT_BOOTSTRAPPED
+ QDateTimePrivate(const QDate &toDate, const QTime &toTime, const QTimeZone & timeZone);
+#endif // QT_BOOTSTRAPPED
+
QDateTimePrivate(const QDateTimePrivate &other) : QSharedData(other),
m_msecs(other.m_msecs),
m_spec(other.m_spec),
m_offsetFromUtc(other.m_offsetFromUtc),
+#ifndef QT_BOOTSTRAPPED
+ m_timeZone(other.m_timeZone),
+#endif // QT_BOOTSTRAPPED
m_status(other.m_status)
{}
qint64 m_msecs;
Qt::TimeSpec m_spec;
int m_offsetFromUtc;
+#ifndef QT_BOOTSTRAPPED
+ QTimeZone m_timeZone;
+#endif // QT_BOOTSTRAPPED
StatusFlags m_status;
void setTimeSpec(Qt::TimeSpec spec, int offsetSeconds);
@@ -129,6 +143,14 @@ public:
inline bool isValidDateTime() const { return (m_status & ValidDateTime) == ValidDateTime; }
inline void setValidDateTime() { m_status = m_status | ValidDateTime; }
inline void clearValidDateTime() { m_status = m_status & ~ValidDateTime; }
+ inline bool isTimeZoneCached() const { return (m_status & TimeZoneCached) == TimeZoneCached; }
+ inline void setTimeZoneCached() { m_status = m_status | TimeZoneCached; }
+ inline void clearTimeZoneCached() { m_status = m_status & ~TimeZoneCached; }
+
+#ifndef QT_BOOTSTRAPPED
+ static qint64 zoneMSecsToEpochMSecs(qint64 msecs, const QTimeZone &zone,
+ QDate *localDate, QTime *localTime);
+#endif // QT_BOOTSTRAPPED
static inline qint64 minJd() { return QDate::minJd(); }
static inline qint64 maxJd() { return QDate::maxJd(); }