From f323d991d438e7bde7157b1818acfabb5010c3b6 Mon Sep 17 00:00:00 2001 From: bluish <734499798@qq.com> Date: Sun, 4 Jan 2026 09:14:08 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/js/timer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/js/timer.js b/frontend/js/timer.js index f6ca7d8..5cf1c8d 100644 --- a/frontend/js/timer.js +++ b/frontend/js/timer.js @@ -230,7 +230,11 @@ class TaskTimer { if (timerStatus && timerStatus.is_running) { // 使用服务器返回的开始时间(从ISO格式字符串创建Date对象) - const startTime = new Date(timerStatus.start_time); + // 如果字符串不包含时区信息,则按UTC处理(补上Z) + const timeString = timerStatus.start_time; + const hasTimezone = /[zZ]|[\+\-]\d{2}:?\d{2}$/.test(timeString); + const normalized = hasTimezone ? timeString : `${timeString}Z`; + const startTime = new Date(normalized); const now = new Date(); // 恢复计时器