美文网首页
倒计时中的天数

倒计时中的天数

作者: Chris__Liu | 来源:发表于2020-02-03 16:57 被阅读0次
    // 详细日期可忽略为 new Date("2021")
    let endTime =  new Date("2021/1/1 00:00:00").getTime() 
    
    let restTime = endTime   -  new Date().getTime()
    
    day = Math.floor(restTime/1000/60/60/24);  
    hour = Math.floor(restTime/1000/60/60);  
    min = Math.floor(restTime/1000/60);  
    sec = Math.floor(restTime/1000); 

    相关文章

      网友评论

          本文标题:倒计时中的天数

          本文链接:https://www.haomeiwen.com/subject/yyahxhtx.html