Carter Harrison
Carter Harrison

Reputation: 69

Understand this date in nodeJS?

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.

Upvotes: 0

Views: 21

Answers (1)

Frish
Frish

Reputation: 1421

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());

Upvotes: 1

Related Questions