menu MING
search tabs
目录

给你自己的博客底部增加运行时长显示

ming
ming 2023年10月25日  ·  阅读 92

底部配置一般在footer文件.
在适应的位置添加以下内容

<span id="website_runtime"></span>
<script type="text/javascript">
function show_runtime(){window.setTimeout("show_runtime()",1000);x=new Date("2023/10/24 21:10:00");y=new Date();z=y.getTime()-x.getTime();mspd=24*60*60*1000;_d=z/mspd;d=Math.floor(_d);_h=(_d-d)*24;h=Math.floor(_h);_m=(_h-h)*60;m=Math.floor(_m);_s=(_m-m)*60;s=Math.floor(_s);website_runtime.innerHTML="博客已运行:"+d+"天"+h+"小时"+m+"分"+s+"秒";}show_runtime();
</script>

以上时间自行更改

分类: 博客笔记
标签: 教程