From 5a295a1009dad3a020be10331fa8e8c6163a9106 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 1 Oct 2018 19:58:40 +0200 Subject: Scale seconds by a thousand to get milliseconds QTimeZonePrivate::dataForLocalTime()'s handling of times in a spring-forward gap added offsets in seconds to values in milliseconds. Supply the missing factor of a thousand. Change-Id: Ic32d87675f902e1c7fd85025fb70c8272a4f2db2 Reviewed-by: Thiago Macieira --- src/corelib/tools/qtimezoneprivate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools/qtimezoneprivate.cpp') diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp index 1a5135f103..54c2f65d94 100644 --- a/src/corelib/tools/qtimezoneprivate.cpp +++ b/src/corelib/tools/qtimezoneprivate.cpp @@ -399,7 +399,7 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs, 0 < tran.atMSecsSinceEpoch - nextTran.atMSecsSinceEpoch = (nextTran.offsetFromUtc - tran.offsetFromUtc) * 1000 */ - int dstStep = nextTran.offsetFromUtc - tran.offsetFromUtc; + int dstStep = (nextTran.offsetFromUtc - tran.offsetFromUtc) * 1000; Q_ASSERT(dstStep > 0); // How else could we get here ? if (nextFirst) { // hint thought we needed nextTran, so use tran tran.atMSecsSinceEpoch -= dstStep; @@ -439,7 +439,7 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs, // Invalid forLocalMSecs: in spring-forward gap. const int dstStep = daylightTimeOffset(early < late ? forLocalMSecs + sixteenHoursInMSecs : - forLocalMSecs - sixteenHoursInMSecs); + forLocalMSecs - sixteenHoursInMSecs) * 1000; Q_ASSERT(dstStep); // There can't be a transition without it ! utcEpochMSecs = (hint > 0) ? forStd - dstStep : forDst + dstStep; } -- cgit v1.2.3