diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2023-04-25 15:15:29 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-02 17:03:27 +0200 |
| commit | 6aea6c25a5e4e6fa93e44d62139f4f9acc30bd93 (patch) | |
| tree | a45c3e4137bc5d8d1c7c29dc0bce96e3bdf34e30 /src/corelib/kernel/qtimer.cpp | |
| parent | 55fe3ee5e784d9d128ffa41b03bcd86e10b41357 (diff) | |
QLocalTime: get offset from correct local time minus UTC time
In mapLocalTime(), we've constructed tmLocal from localSeconds, so
that's the local time mktime()'s returned utcSecs corresponds to. So
use that, rather than freshly dividing the original local milliseconds
by 1000 (now rounding down, instead of towards zero), which could lead
to an off-by-one error. The intermediate offset miscomputed this way
was only used in overflow cases, before being replaced by a more
reliable result, but this saves some computation as well as getting
those right.
Change-Id: Ie34cf53cd2191e277835388fcd62dcf68eaf39c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
0 files changed, 0 insertions, 0 deletions
