Upload files to "backend/app"

This commit is contained in:
2026-10-05 04:03:05 +00:00
parent 47ec7dc9a7
commit 7217b3e9a8
4 changed files with 259 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
from datetime import UTC, datetime
# Every timestamp in the DB uses this exact format, so string comparison == chronological comparison.
DB_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
def utcnow() -> datetime:
return datetime.now(UTC).replace(microsecond=0)
def to_db(dt: datetime) -> str:
return dt.astimezone(UTC).strftime(DB_FORMAT)