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

        <div id="date">
            倒计时还有<span id="span_dt_dt" class="numda"></span>

            <script language="JavaScript" type="text/javascript">

                                            function show_date_time() {
                                                window.setTimeout("show_date_time()", 1000);
                                                BirthDay = new Date("02/02/2011 06:00:00"); //这个日期是可以修改的 
                                                today = new Date();
                                                timeold = (BirthDay.getTime() - today.getTime());
                                                sectimeold = timeold / 1000
                                                secondsold = Math.floor(sectimeold);
                                                msPerDay = 24 * 60 * 60 * 1000
                                                e_daysold = timeold / msPerDay
                                                daysold = Math.floor(e_daysold);
                                                e_hrsold = (e_daysold - daysold) * 24;
                                                hrsold = Math.floor(e_hrsold);
                                                e_minsold = (e_hrsold - hrsold) * 60;
                                                minsold = Math.floor((e_hrsold - hrsold) * 60);
                                                seconds = Math.floor((e_minsold - minsold) * 60);
                                                span_dt_dt.innerHTML = "<b><align=center><font color=D70010>" + daysold + "" + "</font>";
                                            }
                                            show_date_time(); 
       

            </script>        天&nbsp;&nbsp;&nbsp;&nbsp;

        </div>

  • 相关阅读:
    6 完全平方数相关
    5 三位数,每个位置不同
    Neo4j Admin Import 导入多个node和relationship
    Rust所有权
    Rust 多态
    Rust 泛型
    Rust trait
    Rust模块化
    Spring Cloud(Dalston.SR1)
    git 速度慢问题解决
  • 原文地址:https://www.cnblogs.com/majunfeng/p/3933847.html
Copyright © 2011-2022 走看看