倒计时 推迟一天

倒计时

	let start = ""
		// 兼容苹果浏览器  start .replace(/-/g, '/') (手机端也可以用,在时间后面添加**.replace(/-/g, '/')**)
		
        const end = Date.parse(new Date((new Date(start_time)).getTime() + 1000 * 60 * 60 * 24))
        const now = Date.parse(new Date());
        const msec = end - now;
        if (msec < 0) {
          clearInterval(this.time_interval)
          this.time_end = true
          return
        }
        this.time_end = false
        let hr = parseInt(msec / 1000 / 60 / 60 % 24);
        let min = parseInt(msec / 1000 / 60 % 60);
        let sec = parseInt(msec / 1000 % 60);
        this.hr = hr > 9 ? hr : hr;
        this.min = min > 9 ? min : '0' + min;
        this.sec = sec > 9 ? sec : '0' + sec;

猜你喜欢

转载自blog.csdn.net/weixin_45474673/article/details/121998117