When putting and getting a QML date in the u1db database, the resulting strings are stored differently, even if you don't do any type conversion.
The result is that the resulting date is shifted by the current timezone, rendering an incorrect date.
Small example:
date is "Sun Jul 5 17:20:46 2015 GMT+0200"
This value is jsonified in var current = {"title":"First element","date":"2015-07-05T15:20:46.000Z"}
console.log("Before save: " + JSON.stringify(tosave));
db.putDoc(tosave, current.billId);
var after = db.getDoc(current.billId.toString())
console.log("After save: " + JSON.stringify(afterSave));
log is:
qml: Before save: {"title":"First element","date":"2015-07-05T15:20:46.000Z"}
qml: After save: {"date":"2015-07-05T17:20:46","title":"First element"}
-> Note that the date element has been altered and isn't returned in the same format The date should be returned unalterned.
When putting and getting a QML date in the u1db database, the resulting strings are stored differently, even if you don't do any type conversion.
The result is that the resulting date is shifted by the current timezone, rendering an incorrect date.
Small example:
date is "Sun Jul 5 17:20:46 2015 GMT+0200"
This value is jsonified in var current = {"title":"First element" ,"date" :"2015- 07-05T15: 20:46.000Z" }
console.log("Before save: " + JSON.stringify( tosave) ); current. billId. toString( )) afterSave) );
db.putDoc(tosave, current.billId);
var after = db.getDoc(
console.log("After save: " + JSON.stringify(
log is: ,"date" :"2015- 07-05T15: 20:46.000Z" } :"2015- 07-05T17: 20:46", "title" :"First element"}
qml: Before save: {"title":"First element"
qml: After save: {"date"
-> Note that the date element has been altered and isn't returned in the same format The date should be returned unalterned.