From 2922f9e8f251511131e69090d675c1a33bf4a7f5 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Sun, 28 Sep 2025 16:24:46 +0800 Subject: [PATCH] fix: update current_time formatting to include timezone information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1062367 --user=刘瑞斌 【知识库】文档状态中的时间与实际时间有时区差 https://www.tapd.cn/62980211/s/1780536 --- apps/common/event/listener_manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/event/listener_manage.py b/apps/common/event/listener_manage.py index a245d5239..b7122b934 100644 --- a/apps/common/event/listener_manage.py +++ b/apps/common/event/listener_manage.py @@ -237,7 +237,7 @@ class ListenerManagement: next_index = taskType.value + 1 current_index = taskType.value status_number = state.value - current_time = timezone.now().strftime('%Y-%m-%d %H:%M:%S.%f') + '+00' + current_time = timezone.now().astimezone(timezone.get_default_timezone()).strftime('%Y-%m-%d %H:%M:%S.%f%z') params_dict = {'${bit_number}': bit_number, '${up_index}': up_index, '${status_number}': status_number, '${next_index}': next_index, '${table_name}': query_set.model._meta.db_table, '${current_index}': current_index,