读序
years); var diffDays = Math.floor((diff / days) - diffYears * 365); // 区分是否有年份. var language = 'zh-CN'; if (startYear === String(todayYear)) { document.getElementById("year").innerHTML = todayYear; var daysTip = 'This site has been running for ' + diffDays + ' days'; if (language === 'zh-CN') { daysTip = '本站已运行 ' + diffDays + ' 天'; } else if (language === 'zh-HK') { daysTip = '本站已運行 ' + diffDays + ' 天'; } document.getElementById("sitetime").innerHTML = daysTip; } else { document.getElementById("year").innerHTML = startYear + " - " + todayYear; var yearsAndDaysTip = 'This site has been running for ' + diffYears + ' years and ' + diffDays + ' days'; if (language === 'zh-CN') { yearsAndDaysTip = '本站已运行 ' + diffYears + ' 年 ' + diffDays + ' 天'; } else if (language === 'zh-HK') { yearsAndDaysTip = '本站已運行 ' + diffYears + ' 年 ' + diffDays + ' 天'; } document.getElementById("sitetime").innerHTML = yearsAndDaysTip; } } calcSiteTime();