ЛР 2: PostgreSQL и сессии, оценка 3
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-03 17:30:05 +03:00
parent 65003b6119
commit 0cf56ee2b5
21 changed files with 668 additions and 24 deletions
+9
View File
@@ -0,0 +1,9 @@
"""Contract requires RFC3339 UTC timestamps with a literal Z suffix."""
from datetime import datetime, timezone
def utc_z(value: datetime) -> str:
if value.tzinfo is None:
# Database columns are TIMESTAMPTZ, but keep the serializer defensive.
value = value.replace(tzinfo=timezone.utc)
return value.astimezone(timezone.utc).isoformat().replace('+00:00', 'Z')