summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2020-11-30 20:19:12 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2020-12-24 19:41:48 +0100
commit741862875c4bd72ba6d28cf53f6f88579602e4bf (patch)
tree11634e7980db42d416839ecb21374aac50f53eee /src/corelib
parent41e665a452166259b5cad64994de3298751eb7f3 (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. Pick-to: 6.0 Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/time/qdatetime.cpp3
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