2020 년 1 월 30 일 까지 남 았 는데...





    
    <meta charset="utf-8"/>
    <style>
    #con {
        width: 500px;
        height: 200px;
        border: 2px solid fuchsia;
        margin: 30px auto;
    }
    
    #con1 {
        width: 500px;
        height: 100px;
        line-height: 100px;
        font-size: 20px;
    }
    
    #con2 {
        width: 500px;
        height: 100px;
        line-height: 100px;
        font-size: 30px;
        color: darkturquoise
    }
    </style>



    <div id="con">
        <div id="con1">      :</div>
        <div id="con2"/>
    </div>
    <script>
    var con, con1, con2;
    con = document.getElementById("con")
    con1 = document.getElementById("con1")
    con2 = document.getElementById("con2")

    function auto() {
        var time
        time = new Date()
        newtime = new Date(2020, 0, 30)
        tt = newtime.getTime() - time.getTime()
        console.log(tt)
        day = Math.floor(tt / 1000 / 60 / 60 / 24)
        hours = Math.floor((tt - day * 24 * 60 * 60 * 1000) / 1000 / 60 / 60)
        minutes = Math.floor((tt - day * 24 * 60 * 60 * 1000 - hours * 60 * 60 * 1000) / 1000 / 60)
        seconds = Math.floor((tt - day * 24 * 60 * 60 * 1000 - hours * 60 * 60 * 1000 - minutes * 60 * 1000) / 1000)
        millioseconds = Math.floor((tt - day * 24 * 60 * 60 * 1000 - hours * 60 * 60 * 1000 - minutes * 60 * 1000 - seconds * 1000))
            //console.log(day+" "+hours+"  "+minutes+" "+seconds+" ")
        con2.innerHTML = day + " " + hours + "  " + minutes + " " + seconds + " " + millioseconds + "  "
            // console.log(  time.getTime()/1000/60/60/24/365)
    }

    setInterval(auto, 1)
    </script>



</code></pre> 
   </div> 
   <p>  </p> 
  </div> 
  <p>   :https://www.cnblogs.com/wysdddh/p/6260365.html</p> 
 </div> 
</div>
                            </div>
                        </div>

좋은 웹페이지 즐겨찾기