From 339c39c6cafd27d7e7211dfbf4d0082309fb2270 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 28 Oct 2025 17:55:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=B6=E5=8C=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bots/instance/coffee_bot.ts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/bots/instance/coffee_bot.ts b/bots/instance/coffee_bot.ts index f199c47d5..eecc9ab5f 100644 --- a/bots/instance/coffee_bot.ts +++ b/bots/instance/coffee_bot.ts @@ -18,23 +18,17 @@ class CoffeeBot extends BotFather { } protected override getCliQuery(): string { - const now = new Date(); - const beijingNow = new Date( - now.toLocaleString("en-US", { timeZone: "Asia/Shanghai" }) - ); - const weekday = WEEKDAY_NAMES[beijingNow.getDay()]; - - const drawTime = new Date(beijingNow); + const now = new Date(Date.now() + 8 * 60 * 60 * 1000); + const weekday = WEEKDAY_NAMES[now.getDay()]; + const drawTime = new Date(now); drawTime.setHours(23, 0, 0, 0); const drawTimeText = drawTime - .toLocaleTimeString("zh-CN", { - hour: "2-digit", - minute: "2-digit", + .toLocaleTimeString("en-US", { + hour: "numeric", + minute: "numeric", hour12: false, - timeZone: "Asia/Shanghai", - }) - .replace(/^24:/, "00:"); + }); return ` 请立即在 https://www.open-isle.com 使用 create_post 发表一篇全新帖子,遵循以下要求: