代码如下,将11/13/2019修改为网站上线时间即可

<span id="span"></span>
<script type="text/javascript">
    function runtime(){
        // 初始时间,日/月/年 时:分:秒
        X = new Date("11/13/2019 8:32: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);
        //信息写入到DIV中
        span.innerHTML = "本站已经勉强运行了: "+A+"天"+B+"小时"+C+"分"+D+"秒"
    }
    setInterval(runtime, 1000);
</script>

居中代码

<center> 代码 </center>

效果图
1.png