Fix a whole bunch of time conversion test failures on Windows
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 27 Jun 2013 10:37:30 +0000 (12:37 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 27 Jun 2013 12:23:28 +0000 (14:23 +0200)
Take the daylight bias into account if GetTimeZoneInformation reports that the system is in a dayligh savings aware time zone

Change-Id: I4af7d284aa9147651c246b873c6f9d613b414832
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4dateobject.cpp

index e1234e8..b40820a 100644 (file)
@@ -634,8 +634,10 @@ static double getLocalTZA()
     return double(locl - globl) * 1000.0;
 #else
     TIME_ZONE_INFORMATION tzInfo;
-    GetTimeZoneInformation(&tzInfo);
-    return -tzInfo.Bias * 60.0 * 1000.0;
+    LONG daylightBias = 0;
+    if (GetTimeZoneInformation(&tzInfo) == TIME_ZONE_ID_DAYLIGHT)
+        daylightBias = tzInfo.DaylightBias;
+    return -(tzInfo.Bias + daylightBias)* 60.0 * 1000.0;
 #endif
 }