diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2020-11-30 20:19:12 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-24 20:37:04 +0000 |
commit | dae30b73c5de18a69044975886d5b4b9b9b61537 (patch) | |
tree | fbc4f544c1b6bb3497966f86ece290a375fde418 /src/corelib/time | |
parent | 6663d90d19fe40f297cb2e1d5cf9a33a053f4d98 (diff) |
Add test creating QDateTime in double-DST gap in 1947 Germany
In 1947, Germany had not only a summer time but also a
"Hochsommerzeit", a high summer time. This patch adds a test
creating a QDateTime in the time gap at the beginning of this
Hochsommerzeit on May 11, 1947.
Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 741862875c4bd72ba6d28cf53f6f88579602e4bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/time')
-rw-r--r-- | src/corelib/time/qdatetime.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 5ed72dd5e3..f85e4115bb 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -3204,6 +3204,9 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT Q_ASSERT((zoneMSecs - data.atMSecsSinceEpoch) / 1000 == data.offsetFromUtc // If zoneMSecs fell in a spring-forward's gap, we get this instead: || (zoneMSecs - data.atMSecsSinceEpoch) / 1000 == data.standardTimeOffset + // If we have a second DST, like in Europe/Berlin 1947 (mid-summer time). + // If zoneMSecs fell in a gap at beginning of mid-summer time, we get this instead: + || (zoneMSecs - data.atMSecsSinceEpoch) / 1000 == 2 * data.standardTimeOffset // If it fell in a skipped day (Pacific date-line crossings), this happens: || (data.offsetFromUtc - (zoneMSecs - data.atMSecsSinceEpoch) / 1000) % 86400 == 0); // Docs state any time before 1970-01-01 will *not* have any DST applied |