Align the project baseline with the latest admin interface styling and layout structure while documenting setup and usage updates in README.
16 lines
335 B
Python
16 lines
335 B
Python
from __future__ import annotations
|
|
|
|
from datetime import UTC, datetime
|
|
|
|
|
|
def ensure_utc(value: datetime | None) -> datetime | None:
|
|
if value is None:
|
|
return None
|
|
if value.tzinfo is None:
|
|
return value.replace(tzinfo=UTC)
|
|
return value.astimezone(UTC)
|
|
|
|
|
|
def utc_now() -> datetime:
|
|
return datetime.now(UTC)
|