diff options
author | Fabian Bumberger <[email protected]> | 2014-04-22 17:57:54 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-04-24 10:38:52 +0200 |
commit | 6a15a535181b203e20032f73022d734e3e90c129 (patch) | |
tree | c0a91706ee35a796fff88b1590b35f04d9031eb5 /src/qml/jsruntime | |
parent | 24604a44bbf444dfa198b45948ebeede2ff0d71c (diff) |
Fix time zone calculation
The result of local time minus global time might be negative.
On QNX time_t is defined as unsigned int and thus the subtraction
will not produce the expected result.
This patch converts the local time and the global time
to double before subtracting them.
Task-number: QTBUG-35693
Change-Id: Ifa442b242a4aa23c59fa427015346150b89c9343
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index fc94862bfd..ceef88455b 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -633,7 +633,7 @@ static double getLocalTZA() time_t locl = mktime(&t); gmtime_r(&curr, &t); time_t globl = mktime(&t); - return double(locl - globl) * 1000.0; + return (double(locl) - double(globl)) * 1000.0; #else TIME_ZONE_INFORMATION tzInfo; GetTimeZoneInformation(&tzInfo); |