测试一号高亮

测试一号高亮

本站代码模板仅供学习交流使用请勿商业运营,严禁从事违法,侵权等任何非法活动,否则后果自负!
<script>
// 请替换为网站实际开始运行的时间(格式:年, 月-1, 日, 时, 分, 秒)
const startTime = new Date(2023, 0, 1, 0, 0, 0); 

function updateRunTime() {
  const now = new Date();
  const timeDiff = now - startTime; // 计算时间差(毫秒)
  
  // 转换为天、时、分、秒
  const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
  const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
  const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
  
  // 更新页面显示
  document.getElementById('safeRunTime').textContent = 
    `${days}天${hours}时${minutes}分${seconds}秒`;
}

// 首次加载时更新一次,之后每秒更新一次
updateRunTime();
setInterval(updateRunTime, 1000);
</script>

 

温馨提示:本文最后更新于2025-09-20 17:46:43,某些资源环境可能失效,以及链接被和谐,请在下方留言或联系站长
© 版权声明
THE END
喜欢就支持一下吧
点赞7 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容