1.将字符串格式的日期转化为时间戳

var date = new Date(this.value2)

2.转化
this.dataForm.dateTime = date.getFullYear() + '-' + this.checkTime(date.getMonth() + 1) + '-' + this.checkTime(date.getDate())
引用方法
checkTime

checkTime(i) {
if (i < 10) {
i = '0' + i
}
return i
},


相关文章: