formatDate(value) { // 时间戳转换日期格式方法
const date = new Date(value)
const y = date.getFullYear()// 年
let MM = date.getMonth() + 1 // 月
MM = MM < 10 ? ('0' + MM) : MM
let d = date.getDate() // 日
d = d < 10 ? ('0' + d) : d
return y + '-' + MM + '-' + d
},
时间格式转化为yy-MM-dd
最新推荐文章于 2024-06-20 15:06:48 发布