Skip to content

Commit 2922f9e

Browse files
committed
fix: update current_time formatting to include timezone information
--bug=1062367 --user=刘瑞斌 【知识库】文档状态中的时间与实际时间有时区差 https://www.tapd.cn/62980211/s/1780536
1 parent 57439e7 commit 2922f9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/common/event/listener_manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def update_status(query_set: QuerySet, taskType: TaskType, state: State):
237237
next_index = taskType.value + 1
238238
current_index = taskType.value
239239
status_number = state.value
240-
current_time = timezone.now().strftime('%Y-%m-%d %H:%M:%S.%f') + '+00'
240+
current_time = timezone.now().astimezone(timezone.get_default_timezone()).strftime('%Y-%m-%d %H:%M:%S.%f%z')
241241
params_dict = {'${bit_number}': bit_number, '${up_index}': up_index,
242242
'${status_number}': status_number, '${next_index}': next_index,
243243
'${table_name}': query_set.model._meta.db_table, '${current_index}': current_index,

0 commit comments

Comments
 (0)