date: this.getDate(0),effectivityDate: this.getDate(60),
getDate (AddDayCount) { let date = new Date() date.setDate(date.getDate() + AddDayCount)// 获取AddDayCount天后的日期 let y = date.getFullYear() let m = (date.getMonth() + 1) < 10 ? ‘0‘ + (date.getMonth() + 1) : (date.getMonth() + 1)// 获取当前月份的日期,不足10补0 let d = date.getDate() < 10 ? ‘0‘ + date.getDate() : date.getDate()// 获取当前几号,不足10补0 let h = date.getHours()// 获取当前小时 let t = date.getMinutes() < 10 ? ‘0‘ + date.getMinutes() : date.getMinutes()// 获取当前分钟,不足10补0 let s = date.getSeconds() < 10 ? ‘0‘ + date.getSeconds() : date.getSeconds()// 获取当前秒数,不足10补0 return y + ‘-‘ + m + ‘-‘ + d + ‘ ‘ + h + ‘:‘ + t + ‘:‘ + s
时间: 2024-10-11 03:26:54