diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-02-18 18:33:18 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-04-16 10:22:35 +0200 |
commit | 530e0bd469e6859269c2d1a792b8ce819fbff389 (patch) | |
tree | 831bc515f0c5ff8dbc5bcd26622a02a539b65e9b /src/corelib/time/qdatetime_p.h | |
parent | b4a875544ba8f2d11e183d67f45891d6149203ed (diff) |
Use QTimeZone to determine offsets outside the system-function range
Follow up on some comments saying "TODO Use QTimeZone when available"
in converting times, outside the range supported by the system's
time_t functions, between local or zone time and UTC. Since this
required two formerly static functions in qdatetime.cpp to access
QTimeZone's d-ptr, turn those into methods of QTZ's friend QDTPrivate.
Change-Id: I27fe03d8eff9f4e98661263b1a1d4d830f4e7459
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/time/qdatetime_p.h')
-rw-r--r-- | src/corelib/time/qdatetime_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/time/qdatetime_p.h b/src/corelib/time/qdatetime_p.h index 9dcd896d59..8f9773ba72 100644 --- a/src/corelib/time/qdatetime_p.h +++ b/src/corelib/time/qdatetime_p.h @@ -118,6 +118,13 @@ public: static QDateTime::Data create(QDate toDate, QTime toTime, const QTimeZone & timeZone); #endif // timezone + static bool epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTime *localTime, + QDateTimePrivate::DaylightStatus *daylightStatus = nullptr); + static qint64 localMSecsToEpochMSecs(qint64 localMsecs, + QDateTimePrivate::DaylightStatus *daylightStatus, + QDate *localDate = nullptr, QTime *localTime = nullptr, + QString *abbreviation = nullptr); + StatusFlags m_status = StatusFlag(Qt::LocalTime << TimeSpecShift); qint64 m_msecs = 0; int m_offsetFromUtc = 0; |