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>
bb10
Edward Welbourne 2018-10-01 19:58:40 +02:00
parent c958fb8b48
commit 5a295a1009
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}