How do you catch tricky time zone and regional bugs before launching?
by•
Quick question for the builders here. AI coding assistants are great for getting things built fast but they sometimes completely miss real-world context like how dates and times shift across regional boundaries.
We ran into a weird issue where a timezone calculation broke right at a daylight saving line because the logic lacked that real world check.
What’s your go to way to test for these hidden edge cases before a public launch?
14 views
Replies
One case worth adding to the list: a phone whose clock is wrong, not just a different zone. We only caught it from a support ticket after launch. An iPhone had its time zone set to UTC 7 hours behind while the clock showed Spanish local time, so its idea of UTC ran nine hours ahead. Google sign in finished in the native sheet, then the library rejected the fresh token as expired, because it checks the token's expiry against the device clock. Our server was never reached, so it saw nothing. We now turn that exact error into a message asking the user to set date and time automatically, and the emailed sign in link still works on such a phone because the server checks it. A test device set to a wrong zone with a manual clock would have shown it before launch.
Two rules took most of that pain away for me. Every time goes into the database as UTC in a TIMESTAMPTZ column and only gets converted when it's shown. And the agent isn't allowed to work out dates in its head. A hook hands it the real date and a two week calendar on every message, and if it writes a date with the wrong weekday, it gets sent back to rewrite.