修改文件
//運行天數
themes/yilia-plus/layout/_partial/footer.ejs
<span id="sitetime"></span>
<script language=javascript>
function siteTime(){
window.setTimeout("siteTime()", 1000);
var seconds = 1000;
var minutes = seconds * 60;
var hours = minutes * 60;
var days = hours * 24;
var years = days * 365;
var today = new Date();
var todayYear = today.getFullYear();
var todayMonth = today.getMonth()+1;
var todayDate = today.getDate();
var todayHour = today.getHours();
var todayMinute = today.getMinutes();
var todaySecond = today.getSeconds();
/* Date.UTC() -- 返回date對象距世界標準時間(UTC)1970年1月1日午夜之間的毫秒數(時間戳)
year - 做爲date對象的年份,爲4位年份值
month - 0-11之間的整數,作爲date對象的月份
day - 1-31之間的整數,作爲date對象的天數
hours - 0(午夜24點)-23之間的整數,作爲date對象的小時數
minutes - 0-59之間的整數,作爲date對象的分鐘數
seconds - 0-59之間的整數,作爲date對象的秒數
microseconds - 0-999之間的整數,作爲date對象的毫秒數 */
var t1 = Date.UTC(2019,07,16,16,26,13); //建站時間
var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
var diff = t2-t1;
var diffYears = Math.floor(diff/years);
var diffDays = Math.floor((diff/days)-diffYears*365);
var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
document.getElementById("sitetime").innerHTML=" 已運行"+/*diffYears+" 年 "+*/diffDays+" 天 "+diffHours+" 小時 "+diffMinutes+" 分鐘 "+diffSeconds+" 秒";
}/*由於建站時間尚未一年,就將之註釋掉了。須要的能夠取消*/
siteTime();
</script>
//ICP備案
<a href="http://www.beian.miit.gov.cn/" style="color:#f72b07" target="_blank">鄂ICP備19017719號</a>
複製代碼
效果圖