moment 根据当前时间戳,获取当前时间戳后10天的时间戳
当前时间戳为 1712898101 , startTime = 2024/4/12
期望得到时间戳为 1713762101 , endTime = 2024/4/22
created(){
this.getTime(1712898101)
},
methods:{
getTime(time) {
const startTime = moment.unix(time)
const tenDaysLater = moment(startTime).add(10, 'days')
const endTimechuo = moment(tenDaysLater).unix()
return endTimechuo //1713762101
// startTime.format('YYYY-MM-DD HH:mm:ss') 2024/4/12
// tenDaysLater.format('YYYY-MM-DD HH:mm:ss') 2024/4/22
},
},