喜迎
春节
var todayMinute = today.getMinutes(); var todaySecond = today.getSeconds(); var t1 = Date.UTC(startYear, startMonth, startDate, startHour, startMinute, startSecond); 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); if (startYear == todayYear) { document.getElementById("year").innerHTML = todayYear; document.getElementById("sitetime").innerHTML = "本站已运行 " + "" + diffDays + "" + " 天 " + "" + diffHours + "" + " 小时 " + "" + diffMinutes + "" + " 分 " + "" + diffSeconds + "" + " 秒"; } else { document.getElementById("year").innerHTML = startYear + " - " + todayYear; document.getElementById("sitetime").innerHTML = "本站已运行 " + "" + diffYears + "" + " 年 " + "" + diffDays + "" + " 天 " + "" + diffHours + "" + " 小时 " + "" + diffMinutes + "" + " 分 " + "" + diffSeconds + "" + " 秒"; } } setInterval(siteTime, 1000);
川公网安备51011202000905     蜀ICP备2022000541号