nowDate(val){
var starttime = val;
let that=this
var show=setInterval(function () {
let nowtime=Date.parse(new Date())//把当前时间转换成时间戳
// console.log(starttime)
console.log(nowtime);
var time = starttime - nowtime;
// console.log(time)
var day = parseInt(time / 1000 / 60 / 60 / 24);
var hour = parseInt(time / 1000 / 60 / 60 % 24);
var minute = parseInt(time / 1000 / 60 % 60);
var seconds = parseInt(time / 1000 % 60);
console.log( minute + "分钟" + seconds + "秒")
that.showTime=minute + "分钟" + seconds + "秒"
// $('.timespan').html(day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒");
}, 1000);
},
把时间戳转换成倒计时
最新推荐文章于 2024-03-26 19:05:58 发布