Backfill / repair corrupted listings_listing.date_modified (~282k rows) #2

Open
opened 2026-06-06 06:27:48 +00:00 by hclaude · 0 comments
Owner

Timezone bug: date_modified stored as SAST (+2h) but tagged +00:00

Secondary finding (Entry 2). The export writes a timestamp 2 hours ahead of
the DB-logged UTC time, yet with a +00:00 offset:

DB log line (UTC) stored date_modified
12:00:00 UTC 14:00:00+00:00
13:00:00 UTC 15:00:00+00:00
15:00:00 UTC 17:00:00+00:00

SAST = UTC+2 → naive local datetime written with a UTC label. Likely
USE_TZ=False / naive datetime.now() on the app or export host.

Task

  • Confirm Django USE_TZ / TIME_ZONE settings and the host TZ on ::28.
  • Fix so timestamps are stored as true UTC (or consistently tz-aware).
  • Quantify blast radius — this affects every write path with the same
    misconfig, not only the export. Check other auto_now / timestamp cols.

Priority: MEDIUM — corrupts all timestamps subtly; fix before backfill.

## Timezone bug: `date_modified` stored as SAST (+2h) but tagged `+00:00` Secondary finding (Entry 2). The export writes a timestamp **2 hours ahead** of the DB-logged UTC time, yet with a `+00:00` offset: | DB log line (UTC) | stored `date_modified` | |-------------------|------------------------| | `12:00:00 UTC` | `14:00:00+00:00` | | `13:00:00 UTC` | `15:00:00+00:00` | | `15:00:00 UTC` | `17:00:00+00:00` | SAST = UTC+2 → naive local datetime written with a UTC label. Likely `USE_TZ=False` / naive `datetime.now()` on the app or export host. ### Task - [ ] Confirm Django `USE_TZ` / `TIME_ZONE` settings and the host TZ on `::28`. - [ ] Fix so timestamps are stored as true UTC (or consistently tz-aware). - [ ] Quantify blast radius — this affects **every** write path with the same misconfig, not only the export. Check other `auto_now` / timestamp cols. **Priority: MEDIUM** — corrupts all timestamps subtly; fix before backfill.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ECS-investigations/T4A-DB-logs#2
No description provided.