Tech · Confessions
The bug was the timezone. The bug is always the timezone.
A short field guide to the six ways a date can betray you, collected over one very long Tuesday and one increasingly confused customer.
The report said the report was empty. Not wrong, not late — empty, for one customer, on one day of the month, and only if you asked before lunch.
I want to write the rest of this properly, because the shape of the failure was more interesting than the fix. For now, the summary is that we stored a date, called it a day, and it was in fact an instant, and an instant belongs to somewhere.
The six betrayals
- A date that is really a timestamp.
- A timestamp with no zone attached.
- A zone attached at write time but not at read time.
- Midnight, which happens twice a year in some places and never in others.
- A database that helpfully converts, and a client that helpfully converts again.
- Me, assuming any of the above had been handled.
More soon, once I’ve stopped being annoyed about it.