I have the following javascript code working fine in the browser but not in Qt:
var now = new Date()
var then = new Date("2013-12-08T00:10:01Z")
var timeDiff = then.getTime() - now.getTime()
alert(timeDiff)
When I run the same code in Qt timeDiff
returns as NaN
. Does anyone know why Javascript .getTime()
is behaving differently in the Qt environment?
Update
Even the following is returning invalid date
console.log(new Date("2013-12-08"))
Might be related to the following question:
new Date("YYYY-MM-DD") stopped working in Qt WebKit after removing MacPorts
Note: I'm running the Qt on a BlackBerry 10 device hooked up to computer for debugging, not actually running the Qt program on my Mac.