Перенести реализацию мессенджера из ЛР 6

Файлы скопированы без изменений из solution/BPI2301-Vozzhin
репозитория mtusi2026lab6. Доработки ЛР 7 идут отдельными коммитами.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-12-03 19:48:41 +05:00
co-authored by Claude Opus 5.5
parent 20afc2c790
commit 31d441184b
92 changed files with 6153 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
from datetime import datetime, timezone
def to_rfc3339(value: datetime) -> str:
return value.astimezone(timezone.utc).isoformat(timespec='microseconds').replace('+00:00', 'Z')
def from_rfc3339(value: str) -> datetime:
if not isinstance(value, str) or not value.endswith('Z'):
raise ValueError('timestamp must end with Z')
return datetime.fromisoformat(value[:-1]).replace(tzinfo=timezone.utc)