Playbook

Debugging Timezone Bugs

Time bugs usually live at day boundaries, DST changes, and unit conversions.

Pattern

Code assumes local, UTC, seconds, or milliseconds in the wrong place.

warningSymptoms

  • arrow_rightReports missing records
  • arrow_rightExpiry happens early or late
  • arrow_rightOnly one timezone reproduces the incident

searchWhere to look

  • arrow_rightDate parsing
  • arrow_rightBoundary queries
  • arrow_rightScheduler timezone
  • arrow_rightSeconds vs milliseconds

buildCommon fixes

  • arrow_rightStore UTC instants
  • arrow_rightMake timezone explicit
  • arrow_rightTest boundary dates

Practice challenges