From 82437582fe8f37c32a5d7fc884edecf4f213f1b6 Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Sun, 31 Aug 2025 19:43:32 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4=E8=A7=A3=E6=9E=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/sdk/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/sdk/common.py b/app/sdk/common.py index 068890c..46d0150 100644 --- a/app/sdk/common.py +++ b/app/sdk/common.py @@ -11,5 +11,6 @@ def iso_to_cst(iso_time_str: str) -> str: str: CST(China Standard Time) 时间字符串 """ dt = datetime.fromisoformat(iso_time_str) - dt_cst = dt.astimezone(timezone(timedelta(hours=8))) + tz = timezone(timedelta(hours=8)) + dt_cst = dt if dt.astimezone(tz) > datetime.now(tz) else dt.astimezone(tz) return dt_cst.strftime("%Y-%m-%d %H:%M:%S") if dt_cst.year >= 1970 else ""