-- One-shot: devices.created_at on/after Sep 17 still +8h (missed by 14:00 cutoff). -- Do not re-run the previous shift-old-datetimes script. SET time_zone = '+08:00'; SET @from = '2026-09-17 00:00:00'; SELECT COUNT(*) AS n, MIN(created_at) AS mn, MAX(created_at) AS mx FROM devices WHERE created_at IS NOT NULL AND created_at >= @from; UPDATE devices SET created_at = DATE_SUB(created_at, INTERVAL 8 HOUR) WHERE created_at IS NOT NULL AND created_at >= @from; SELECT ROW_COUNT() AS created_at_updated; SELECT id, device_id, created_at, updated_at FROM devices WHERE created_at IS NOT NULL ORDER BY created_at DESC LIMIT 5;