美文网首页
WordPress-底部显示网站已运行时间

WordPress-底部显示网站已运行时间

作者: denghuo7743 | 来源:发表于2019-06-04 17:11 被阅读0次

    把代码代码复制到footer.php或者右侧html小工具,即可。

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

    相关文章

      网友评论

          本文标题:WordPress-底部显示网站已运行时间

          本文链接:https://www.haomeiwen.com/subject/vpjrxctx.html