我如何表达这个日期2018-11-04T14:00:00-07:00?我从 NWS API 得到这个。我尝试过使用 Date() 和其他功能。
1 回答
1
查看Date()上的文档。不确定您要使用哪种格式,但请尝试使用这些方法,特别是toDateString()
var date = new Date('2018-11-04T14:00:00-07:00');
console.log(date.toDateString());
于 2018-11-04T22:40:41.253 回答