版本一:PHP
0, "days" => 0, "hours" => 0,
"minutes" => 0, "seconds" => 0,
);
if($time >= 31556926){
$value["years"] = floor($time/31556926);
$time = ($time%31556926);
}
if($time >= 86400){
$value["days"] = floor($time/86400);
$time = ($time%86400);
}
if($time >= 3600){
$value["hours"] = floor($time/3600);
$time = ($time%3600);
}
if($time >= 60){
$value["minutes"] = floor($time/60);
$time = ($time%60);
}
$value["seconds"] = floor($time);
return (array) $value;
}else{
return (bool) FALSE;
}}// 本站创建的时间$site_create_time = strtotime('2017-09-01 00:00:00');$time = time() - $site_create_time;$uptime = Sec2Time($time);?>本站运行:年天小时分秒
将本站运行以前的代码放到网站的footer中,然后将最后一行代码插入统计代码当中或网站合适的位置即可
版本二:js
网站运行: