formatDate(date) {
var year = date.getFullYear()
var month = this.format(date.getMonth() + 1)
var da = this.format(date.getDate())
// var h = this.format(date.getHours())
// var m = this.format(date.getMinutes())
// var s = this.format(date.getSeconds())
// return year + '-' + month + '-' + da + ' ' + h + ':' + m + ':' + s
return year + '-' + month + '-' + da
},
format(val) {
return Number(val) < 10 ? '0' + val : '' + val
},
new Date时间戳格式-转换yyyy-MM-dd
最新推荐文章于 2024-04-17 11:57:44 发布