admin

添加网站运行时间代码
把一下代码加入你要显示运行时间的地方即可站点已稳定运行:<SPAN id=span_dt_dt style=...
扫描右侧二维码阅读全文
30
2018/06

添加网站运行时间代码

把一下代码加入你要显示运行时间的地方即可

站点已稳定运行:<SPAN id=span_dt_dt style="color: #2F889A;"></SPAN>
<SCRIPT language=javascript>function show_date_time(){
  window.setTimeout("show_date_time()", 1000);
  BirthDay=new Date("6/31/2018 23:32:13");
  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='<font style=color:#C40000>'+daysold+'</font> 天 <font 
  style=color:#C40000>'+hrsold+'</font> 时 <font style=color:#C40000>'+minsold+'</font> 分 <font 
  style=color:#C40000>'+seconds+'</font> 秒';
}
show_date_time();</script>

注意自己修改下时间
代码来源:九四君博客

Last modification:July 1st, 2018 at 11:57 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment