### 思路分析 使用 Math.floor(Date.now() / 1000) 获取当前秒级时间戳 使用 new Date().getTime() / 1000 然后取整 实时更新时间戳显示 ```javascript // 获取当前秒级时间戳 function getTimestamp() { return Math.floor(Date.now() / 1000); } ```