//UTC 转指定格式日期
let date = '2018-03-07T16:00:00.000Z'
console.log(moment(date).format('YYYY-MM-DD HH:mm:ss'))

//GMT
let localTime = moment.utc(date).toDate();
console.log(localTime)

//本地日期转UTC
console.log(new Date("2018-03-08 00:00:00").toISOString())
posted on 2018-03-14 13:13  阿梅M  阅读(12698)  评论(3编辑  收藏  举报