mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 01:57:11 -05:00
Use timezone-aware timestamps and update tests
This commit is contained in:
4
backend/app/utils/__init__.py
Normal file
4
backend/app/utils/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
"""Utility helpers for the BlackRoad backend."""
|
||||
|
||||
from .datetime import utc_now # noqa: F401
|
||||
|
||||
9
backend/app/utils/datetime.py
Normal file
9
backend/app/utils/datetime.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""Datetime utilities."""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
|
||||
def utc_now() -> datetime:
|
||||
"""Return a timezone-aware UTC datetime."""
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
Reference in New Issue
Block a user