From 476ebf976f3010f3593cec34e5d9b31335ad72a4 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Thu, 27 Mar 2014 11:53:23 +0000 Subject: Call tzset() from getLocalTZA() so we learn about tz changes Per POSIX, localtime_r isn't required to call tzset(). This means that we don't notice that the timezone has changed when calling Date.timeZoneUpdated() from JS. Call this in getLocalTZA() so that it always returns results pertaining to the selected timezone. Task-number: QTBUG-37683 Change-Id: Ia9098ef0100b7c909a82b125a5ea4f39fba1f306 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4dateobject.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/jsruntime/qv4dateobject.cpp') diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index f2e7573452..fc94862bfd 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -627,6 +627,7 @@ static double getLocalTZA() #ifndef Q_OS_WIN struct tm t; time_t curr; + tzset(); time(&curr); localtime_r(&curr, &t); time_t locl = mktime(&t); -- cgit v1.2.3