From ad620f02c726202fbdef509b5d21bf7f2ce4a21e Mon Sep 17 00:00:00 2001 From: liuzhenghua <1090179900@qq.com> Date: Sat, 25 May 2024 13:11:18 +0800 Subject: [PATCH] fix: the date is incorrect if the db field is timestamp and the TZ is not the UTC (#4624) Co-authored-by: liuzhenghua-jk --- api/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/config.py b/api/config.py index 07881c363a..5ec2f6771c 100644 --- a/api/config.py +++ b/api/config.py @@ -179,7 +179,8 @@ class Config: 'pool_size': int(get_env('SQLALCHEMY_POOL_SIZE')), 'max_overflow': int(get_env('SQLALCHEMY_MAX_OVERFLOW')), 'pool_recycle': int(get_env('SQLALCHEMY_POOL_RECYCLE')), - 'pool_pre_ping': get_bool_env('SQLALCHEMY_POOL_PRE_PING') + 'pool_pre_ping': get_bool_env('SQLALCHEMY_POOL_PRE_PING'), + 'connect_args': {'options': '-c timezone=UTC'}, } self.SQLALCHEMY_ECHO = get_bool_env('SQLALCHEMY_ECHO')