netx/netx_api/timeutil.py
oliver a2f91f6ee2 Split port traffic service and replace deprecated UTC/lifespan APIs.
Keep the public facade stable while moving device CRUD and sample/compare
logic into focused modules, and use naive UTC via timeutil plus FastAPI lifespan.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 17:06:46 +08:00

9 lines
257 B
Python

"""Timezone helpers. DB columns store naive UTC; keep values naive for comparisons."""
from __future__ import annotations
from datetime import datetime, timezone
def utcnow_naive() -> datetime:
return datetime.now(timezone.utc).replace(tzinfo=None)