Q&A
How do you handle timezone-related test failures in a distributed team?
Ajitesh MohantaAmbassador
Apr 29, 2026 927 0
We have engineers in India, UK, and US. Our tests occasionally fail due to timezone-dependent logic:
- Date range filters that work in one timezone but not another
- "Created today" queries that break at midnight UTC in one timezone
- Scheduled job tests that assume server timezone
Current workaround: all CI runs in UTC, local development also forced to UTC via `TZ=UTC` env var.
But we still get failures when: the test uses `datetime.now()` without timezone awareness, or when the application has hardcoded timezone assumptions we haven't found yet.
Any systematic approach to finding and fixing timezone-naive code in tests and application code?