Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P3: Somewhat important
-
Resolution: Done
-
Affects Version/s: 5.0.2
-
Fix Version/s: 5.11.0
-
Component/s: QML: Declarative and Javascript Engine
-
Labels:None
-
Commits:948e24cb6deeaf0e55794032b90fdf20b7ef12c1
Description
See attached project. I'm in CET (UTC+1), so it is incorrectly assuming local time.
QML from the project:
import QtQuick 2.0 import test 1.0 Item { id: root QuickDate { Component.onCompleted: { console.log(" actual date = " + date.toUTCString()); console.log("expected date = " + new Date("Thu, 01 Jan 1970 00:00:00 GMT").toUTCString()); } } }
Output:
actual date = Wed, 31 Dec 1969 23:00:00 GMT
expected date = Thu, 01 Jan 1970 00:00:00 GMT
This seems to be because a QDateTime object is constructed from the QDate object using the constructor that will set the timeSpec to Qt::LocalTime.
Attachments
Issue Links
- relates to
-
QTBUG-25262 Dates without times are wrong in QML
-
- Closed
-