Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.4.0
-
None
Description
Consider:
import QtQuick 2.0 Item { width: 360 height: 360 property date date1: new Date() Component.onCompleted: { console.log("date1 initial value: " + date1) var tmpDate = date1 console.log("tmpDate initial value: " + tmpDate) date1.setUTCFullYear(1000) console.log("date1 1000 year value: " + date1 + " (unexpected result!)") tmpDate.setUTCFullYear(1000) console.log("tmpDate 1000 year value: " + tmpDate) } }
You get:
qml: date1 initial value: Fri Dec 12 14:06:50 2014 GMT+0100 qml: tmpDate initial value: Fri Dec 12 14:06:50 2014 GMT+0100 qml: date1 1000 year value: Fri Dec 12 14:06:50 2014 GMT+0100 (unexpected result!) qml: tmpDate 1000 year value: Fri Dec 12 14:06:50 1000 GMT+0100
The third line should state something with year 1000.
Attachments
Issue Links
- is duplicated by
-
QTBUG-28981 Date.setDate does nothing
- Closed
- replaces
-
QTBUG-36811 Qml date behaves unexpectedly for negative years
- Closed