chore: 基础设施 — 阿里云源、北京时间、HEX计数器、打印机配置
This commit is contained in:
10
backend/app/core/time_utils.py
Normal file
10
backend/app/core/time_utils.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""全局北京时间 (UTC+8)"""
|
||||
from datetime import datetime
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
BEIJING_TZ = ZoneInfo("Asia/Shanghai")
|
||||
|
||||
|
||||
def get_beijing_time() -> datetime:
|
||||
"""返回当前北京时间"""
|
||||
return datetime.now(BEIJING_TZ)
|
||||
Reference in New Issue
Block a user