I have a UTC date string like this "2013-08-22T00:35:00", how do I use Javascript to convert it to a local computer time? so after conversion the time should be 2013-08-21 20:35
Thanks
I have a UTC date string like this "2013-08-22T00:35:00", how do I use Javascript to convert it to a local computer time? so after conversion the time should be 2013-08-21 20:35
Thanks
Does
new Date("2013-08-22T00:35:00") work for you?
Or just use libraries designed for that, like moments.js
moment("2013-08-22T00:35:00"); JavaScript convert datetime string to local on creating new instance.
var date = new Date("2013-08-22T00:35:00"); date.toString() //local date