zoukankan      html  css  js  c++  java
  • 倒计时

    // 倒计时
        countdown() {
          var reg = /^d{2}$/
          var ending = new Date(this.days)
          var now = new Date()
          if (now >= ending) {
            clearTimeout(this.timeout)
            return
          }
          var disc = ending - now
          this.hour = parseInt(disc / 1000 / 60 / 60 % 24)
          this.hour = !reg.test(this.hour) ? '0' + this.hour : this.hour
          this.minutes = parseInt(disc / 1000 / 60 % 60)
          this.minutes = !reg.test(this.minutes) ? '0' + this.minutes : this.minutes
          this.seconds = parseInt(disc / 1000 % 60)
          this.seconds = !reg.test(this.seconds) ? '0' + this.seconds : this.seconds
          this.timeout = setTimeout(this.countdown, 1000)
          return this.minutes
        },
        // 当前时间往后固定时间
        getTime(day) {
          var today = new Date()
          var endMouth = today.getMonth() + 1
          if (endMouth < 10) {
            endMouth = '0' + endMouth
          }
          var beforMilliseconds = today.getTime() + 1000 * 3600 * 24 * day
          var beforday = new Date()
          beforday.setTime(beforMilliseconds)
          var strYear = beforday.getFullYear()
          var strDay = beforday.getDate()
          var strMonth = beforday.getMonth() + 1
          let hour = beforday.getHours()
          let minute = beforday.getMinutes()
          let second = beforday.getSeconds()
          if (strMonth < 10) {
            strMonth = '0' + strMonth
          }
          return strYear + '/' + strMonth + '/' + strDay + ' ' + hour + ':' + minute + ':' + second
        },
    created() {
        this.days = this.getTime(0.03125)
      },
  • 相关阅读:
    跑路了
    *CTF 2019 quicksort、babyshell、upxofcpp
    pyspark如何遍历broadcast
    pwn易忘操作原理笔记
    pwn学习之四
    pwn学习之三
    pwn学习之二
    pwn学习之一
    2017GCTF部分writeup
    OD使用教程12
  • 原文地址:https://www.cnblogs.com/taochengyong/p/14337990.html
Copyright © 2011-2022 走看看