---
title: "Building On-call: Time, timezones, and scheduling"
description: "incident.io's on-call scheduler computes who is on shift from rotations with working hours, round-robin handovers and overrides, and getting it right depends on being precise about local time, offsets, IANA timezones, instants and durations."
url: "https://swe.quest/articles/building-on-call-time-timezones-and-scheduling-f978980b35f41e6a"
canonical: "https://incident.io/blog/time-time-zones-and-scheduling"
source: "incident.io"
published: "2024-07-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["time-clocks","scheduling","testing","postgres","go"]
---

# Building On-call: Time, timezones, and scheduling

A post on [incident.io](https://swe.quest/sources/incident-io.md), published 2024-07-18, 11 min read, Case study. Original: [https://incident.io/blog/time-time-zones-and-scheduling](https://incident.io/blog/time-time-zones-and-scheduling)

## Summary

incident.io's on-call scheduler computes who is on shift from rotations with working hours, round-robin handovers and overrides, and getting it right depends on being precise about local time, offsets, IANA timezones, instants and durations. The design keeps everything as UTC instants (Postgres timestamptz, Go's time package) and converts to wall-clock time only at the edges or in isolated, well-tested calculations such as working hours. Users wanted schedules shown in their own timezone, and sometimes several at once, rather than the schedule's timezone. Correctness rests on unit-tested building blocks, JSON snapshot tests of schedule evaluations flagged in PRs via danger.js, and a periodic runtime audit job that re-evaluates active schedules against the cached on-call state.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Time & clocks](https://swe.quest/tags/time-clocks.md) (Distributed systems)
- [Scheduling](https://swe.quest/tags/scheduling.md) (Distributed systems)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Go](https://swe.quest/tags/go.md) (Languages)

## Prerequisites

- Timezones and DST basics

## Keywords

incident.io On-call, IANA tz database, timestamptz, PostgreSQL, Go, Sherlock, danger.js, snapshot testing

## Related posts

- [Who's on call? How we improved schedule rendering performance 2,500x](https://swe.quest/articles/who-s-on-call-how-we-improved-schedule-rendering-performance-2-500x-8f76a3cfe21d61b4.md): incident.io · 2026-04-28 · Medium · 17 min read · Performance engineering, Go, Algorithms, AI for coding, Debugging
  incident.io's on-call schedule renderer, which computes future shifts on the fly from rotation config, working hours and fair-scheduling rules, became dramatically faster through a series of fixes culminating in a ~2,500x speedup.
- [Run Scheduled and Recurring Tasks with Cron](https://swe.quest/articles/run-scheduled-and-recurring-tasks-with-cron-ca49b6813f0599a8.md): Railway · 2025-11-26 · Medium · 10 min read · Scheduling, Deployment, PostgreSQL
  Cron runs commands on time-based schedules but keeps no job history, has no retries and does no concurrency control, so reliability depends on the job itself.
- [Tracking Time Without Clock](https://swe.quest/articles/tracking-time-without-clock-7964e27d177f0db1.md): TigerBeetle · 2025-10-21 · Medium · 2 min read · Time & clocks, Testing, Zig, System design
  Instead of threading a full virtualized Clock interface through every component, two lighter patterns often suffice for handling time in reliable systems.
- [Three Clocks are Better than One](https://swe.quest/articles/three-clocks-are-better-than-one-10703f0b75ab21bf.md): TigerBeetle · 2021-08-30 · Medium · 5 min read · Time & clocks, Distributed systems, Linux
  TigerBeetle builds a fault-tolerant "cluster time" by measuring clock offsets to peers during keepalive probes.
- [Fixing JavaScript Timezone Issues](https://swe.quest/articles/fixing-javascript-timezone-issues-f0da06400f048fb6.md): Neon · 2025-01-31 · Medium · 2 min read · JavaScript, Time & clocks, PostgreSQL
  A parking booking app stored Italian users' midnight bookings as 6:00 PM the previous day in a US-hosted Postgres database, because \`new Date(selectedDate)\` attached the browser's local timezone before the value reached the API.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
