js时间戳转日期拼接

采用下面方法 返回的为13位的时间戳
function formatDateTimeStamp(now) { // 时间戳转日期拼接
let errDate = new Date(now + 8 * 3600 * 1000)
return errDate.toJSON().substr(0, 19).replace('T', ' ')
},
formatDateTimeStamp(time)
formatDate(1585666736000) // 结果为2020-03-31 22:58:56

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×