fix: enforce Beijing Time (UTC+8) globally by replacing datetime.utcnow
This commit is contained in:
@ -16,8 +16,8 @@ redis_client = None
|
||||
|
||||
|
||||
def beijing_time():
|
||||
"""获取北京时间 (UTC+8)"""
|
||||
return datetime.now(timezone(timedelta(hours=8)))
|
||||
"""获取北京时间 (UTC+8),剥离时区信息以兼容数据库 naive DateTime 字段"""
|
||||
return datetime.now(timezone(timedelta(hours=8))).replace(tzinfo=None)
|
||||
|
||||
|
||||
# 2. 定义初始化函数 (供工厂函数 create_app 调用)
|
||||
|
||||
Reference in New Issue
Block a user