startTimeChange() {
// 得到后一天得时间
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24)
const year = date.getFullYear()
const month = date.getMonth() + 1 // getMonth()返回值是0~11
const day = date.getDate()
let hour = date.getHours();
let minute = date.getMinutes();
let second = date.getSeconds();
const result =
year +
'-' +
(month < 10 ? '0' + month : month) +
'-' +
(day < 10 ? '0' + day : day)
this.endTime = result
// "2023-01-04"
},
时间格式化 js
最新推荐文章于 2024-09-17 11:42:54 发布