0

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

1

2 Answers 2

2

Does

new Date("2013-08-22T00:35:00") 

work for you?

MDN

Or just use libraries designed for that, like moments.js

moment("2013-08-22T00:35:00"); 
Sign up to request clarification or add additional context in comments.

Comments

0

JavaScript convert datetime string to local on creating new instance.

var date = new Date("2013-08-22T00:35:00"); date.toString() //local date 

Here is demo

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.