From 6ff1b68f1bb3ab8c706fe55e7ed96ce76236d12b Mon Sep 17 00:00:00 2001 From: spark Date: Fri, 7 Feb 2025 11:21:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=20GitHub=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=BD=AC=E6=8D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了 getTimezoneOffset() * 60 * 1000 的计算 -现在直接使用 utcDate.getTime() 获取时间戳 --- frontend/src/components/stock.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/components/stock.vue b/frontend/src/components/stock.vue index a1c2fdd..ad3bb6e 100644 --- a/frontend/src/components/stock.vue +++ b/frontend/src/components/stock.vue @@ -163,10 +163,8 @@ EventsOn("updateVersion",async (msg) => { const githubTimeStr = msg.published_at; // 创建一个 Date 对象 const utcDate = new Date(githubTimeStr); - // 获取本地时间 - const date = new Date(utcDate.getTime() + utcDate.getTimezoneOffset() * 60 * 1000); - + const date = new Date(utcDate.getTime()); const year = date.getFullYear(); // getMonth 返回值是 0 - 11,所以要加 1 const month = String(date.getMonth() + 1).padStart(2, '0');