初始化提交

This commit is contained in:
chenxin committed 2026-08-21 16:00:13 +08:00
commit 887c1f449e
963 files changed
+166869

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
"""时间工具。"""
from datetime import UTC, datetime
def utc_now() -> datetime:
return datetime.now(UTC)
def to_iso(value: datetime | None) -> str | None:
if value is None:
return None
if value.tzinfo is None:
value = value.replace(tzinfo=UTC)
return value.astimezone(UTC).isoformat().replace("+00:00", "Z")