Document inconsistency with JS-to-Qt date/time conversion
authorMatthew Vogt <matthew.vogt@nokia.com>
Mon, 14 May 2012 23:41:34 +0000 (09:41 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 15 May 2012 22:48:28 +0000 (00:48 +0200)
The Qt locale object can yield an incorrect date/time string when
there is a variation in interpretation of historical DST
applicability.

Change-Id: Ie1e66f0ed838da4972359634bd3ea1ebd692cc3d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/qml/doc/src/qmldate.qdoc

index 696d97b..3931aa6 100644 (file)
 
     If the date is invalid, an empty string will be returned.
 
+    Note: Using the locale-aware functions to perform date or time formatting can
+    result in incorrectly formatted times, due to an inconsistency in specification
+    between Qt and JS.  ECMA-262 specifies that historical dates should be intrepreted
+    by projecting the current rules for daylight-saving onto past years, while Qt uses
+    historical data (where available) to determine whether daylight-saving was in
+    effect for a given date.  Therefore, constructing a Date value in JS and converting
+    it to a string using the locale-aware functions can yield a result incorrect by one
+    hour, if DST is currently in effect, while it was not for the time specified, or
+    vice versa.
+
     \sa {QtQuick2::Locale}{Locale}
 */