a digital entity named phi that roams bsky phi.zzstoatzz.io
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: use UTC-aware timestamps for cosmik card TID decoding

JavaScript's new Date() interprets ISO strings without timezone as
browser-local time. Since the server runs in UTC on Fly.io, CT users
saw cards as ~5h in the future → negative "seconds ago" on the status page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

zzstoatzz 96036aa1 f8c9e26c

+2 -2
+2 -2
src/bot/main.py
··· 4 4 import logging 5 5 import time 6 6 from contextlib import asynccontextmanager 7 - from datetime import datetime 7 + from datetime import UTC, datetime 8 8 9 9 import httpx 10 10 import logfire ··· 388 388 n = n * 32 + _TID_CHARSET.index(ch) 389 389 # 64-bit TID: bit 63=0, bits 62..10=timestamp(us), bits 9..0=clockid 390 390 us = (n >> 10) & ((1 << 53) - 1) 391 - dt = datetime.fromtimestamp(us / 1_000_000) 391 + dt = datetime.fromtimestamp(us / 1_000_000, tz=UTC) 392 392 return dt.isoformat() 393 393 except (ValueError, OSError): 394 394 return ""