Phillip Senn
Phillip Senn

Reputation: 47663

Converting a date/time string to a date object

I have a string:

"2014-07-30T21:11:35.6300000"

but when I do

new Date(str)

It computes:

Wed Jul 30 2014 17:11:35 GMT-0400 (Eastern Daylight Time)

Q: How do I tell JavaScript not to calculate GMT -0400?

Upvotes: 0

Views: 44

Answers (1)

Gohan
Gohan

Reputation: 2460

(new Date("2014-07-30T21:11:35.6300000")).toUTCString()

Upvotes: 1

Related Questions