so I have a timestamp in mysql that is:
SELECT `tsdate`, UNIX_TIMESTAMP( `tsdate`) FROM t1
2010-11-07 21:50:05, 1289191805
If I try and use the following, it displays the wrong time/date
var newDate = new Date();
newDate.setTime(1289191805000);
dateString = newDate.toUTCString();
alert(dateString);
Mon, 08 Nov 2010 04:50:05 GMT
How can I get JavaScript to show the correct date?
I'm currently using the tool highcharts to grapth, and it is showing the wrong date/time as well (it's written in JavaScript). I don't want to change the code of highcharts, but I will if needed.
Thanks, Josh
.toString()will produce the correct time!