fix: UTC timezone suffix missing from all isoformat() timestamp outputs
db.py returned all datetime columns (first_seen, last_seen, resolved_at, created_at, expires_at) as bare ISO strings like "2026-03-14T14:14:21" with no timezone marker. Per the ECMAScript spec, new Date() on a datetime string without timezone treats it as LOCAL time, not UTC. This made lt.time.ago() and stale-detection wrong for any user whose browser is not in UTC — event ages and stale warnings would be off by the client's UTC offset. monitor.py had the same issue on the network_snapshot 'updated' field. Fix: append 'Z' to all isoformat() calls (UTC datetimes confirmed by MySQL server timezone and _now_utc() pattern used throughout codebase). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -918,7 +918,7 @@ class NetworkMonitor:
|
||||
return {
|
||||
'hosts': hosts,
|
||||
'unifi': display_unifi,
|
||||
'updated': datetime.utcnow().isoformat(),
|
||||
'updated': datetime.utcnow().isoformat() + 'Z',
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user