博客底部添加运行时间js代码

以下的运行时间js代码代码在本博客Begin主题中运行正常,其他没有条件测试。

0x01 运行时间js代码

<span id="runtime_span"></span>
<script type="text/javascript">
    function show_runtime() {
        window.setTimeout("show_runtime()", 1000);
        X = new Date("3/10/2019 5:22: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>

0x02 将一下时间修改为你的建站时间

X = new Date("3/10/2019 5:22:00");
相关推荐
python ERROR: Command errored out with exit status 1:
Windows Server 2016 搭建 SMB 共享文件
Windows Server 2019 域环境搭建 SMB 共享文件服务
Parallels Desktop 15.1.3