一、配置方式

  • 1、直接粘贴代码,放到header.php中,Date("10/11/2017 7:00:00") 改成自己要的时间。
    <script type="text/javascript">
    function show_runtime() {
        window.setTimeout("show_runtime()", 1000);
        X = new Date("10/11/2017 7:00:00");
        Y = new Date();
        T = (Y.getTime() - X.getTime());
        M = 24 * 60 * 60 * 1000;
        a = T / M;
        A = Math.floor(a);
        b = (a - A) * 24;
        B = Math.floor(b);
        c = (b - B) * 60;
        C = Math.floor((b - B) * 60);
        D = Math.floor((c - C) * 60);
        runtime_span.innerHTML = "网站在各种灾难中运行了: " + A + "天" + B + "小时" + C + "分" + D + "秒"
    }
    show_runtime();
    </script>
  • 2、在footer.php中粘贴如下代码
    <span id="runtime_span"></span>

二、成果展示

(查看网页底部运行时间)


"来路风尘仆仆,毕竟神明不渡众生苦..."