Understand this date in nodeJS?

1108 views javascript
8

How do I phrase this date 2018-11-04T14:00:00-07:00? I got this from the NWS API. I have tried using Date() and other functions.

answered question

Is it in text format?

@DominiqueFortin Yes

1 Answer

4

Check out the docs on Date(). Not sure what format you're after but try the methods, specifically toDateString()

var date = new Date('2018-11-04T14:00:00-07:00');

console.log(date.toDateString());

posted this

Have an answer?

JD

Please login first before posting an answer.

Ads

Categories