MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / apply_process_timezone

Function apply_process_timezone

src/core/timezone_utils.py:24–34  ·  view source on GitHub ↗

尝试将进程默认时区设置为 Asia/Shanghai。

()

Source from the content-addressed store, hash-verified

22
23
24def apply_process_timezone() -> None:
25 """
26 尝试将进程默认时区设置为 Asia/Shanghai。
27 """
28 try:
29 os.environ.setdefault("TZ", "Asia/Shanghai")
30 if hasattr(time, "tzset"):
31 time.tzset()
32 except Exception:
33 # 不阻断主流程
34 pass
35
36
37def now_shanghai() -> datetime:

Callers 1

setup_applicationFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected