Lingki Chin

网站运行时间代码
给你的网站加上以下代码,用于记录运行时间 加在你喜欢的位置即可。请自行修改部分数据!! <div sty...
扫描右侧二维码阅读全文
13
2018/03

网站运行时间代码

给你的网站加上以下代码,用于记录运行时间
加在你喜欢的位置即可。请自行修改部分数据!!

<div style=" width:960px; margin:0 auto; text-align: margin-top:0px">
<span id="span_dt_dt"></span>
</div>
<script>
    function show_date_time() {
        window.setTimeout("show_date_time()", 1000);
        BirthDay = new Date("2/10/2018 00:00:01");
        today = new Date();
        //总时间
        timeold = (today.getTime() - BirthDay.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 = "弱弱的存在:" + daysold + "天" + hrsold + "小时" + minsold + "分" + seconds + "秒";
    }
    show_date_time();
</script>
Last modification:April 13th, 2019 at 07:55 am
If you think my article is useful to you, please feel free to appreciate

One comment

  1. 呵呵
      Windows 10 x64 Edition(Windows 10 x64 Edition) / Sogou Explorer(Sogou Explorer)
    该评论仅登录用户及评论双方可见

Leave a Comment