diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-10-01 19:58:40 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-10-02 13:49:31 +0000 |
commit | 5a295a1009dad3a020be10331fa8e8c6163a9106 (patch) | |
tree | bbbad7ec453217be946fb6c420f1c9b42ee47b4e | |
parent | c958fb8b488ea6e86365298796d5710ec4deccc9 (diff) |
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 <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/tools/qtimezoneprivate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |