js时间戳转成“年月日”格式

let baseTime = 1523721600000let time = moment(baseTime).format()let d = new Date(time); let batchDate = d.getFullYear() + '年' + (d.getMonth() + 1) + '月' + d.getDate() +'日'let batchTime = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds(); console.log(baseTime); console.log(time); console.log(d); console.log(batchDate); console.log(batchTime);

【js时间戳转成“年月日”格式】js时间戳转成“年月日”格式
文章图片

    推荐阅读