// 毫秒数转换为时间
getDate(str) {
let oDate = new Date(str)
let oYear = oDate.getFullYear()
let oMonth = oDate.getMonth() + 1
let oDay = oDate.getDate()
let oHour = oDate.getHours()
let oMin = oDate.getMinutes()
let oSen = oDate.getSeconds()
return oYear + '-' + this.addZero(oMonth) + '-' + this.addZero(oDay) + '-' + this.addZero(oHour) + ':' +
this.addZero(oMin) + ':' + this.addZero(oSen)
},
addZero(num) {
if (parseInt(num) < 10) {
num = "0" + num
}
return num
}
07-22
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交