Black Friday: 30% off every plan through November 30. See the prices
SysDesignPrep.com
Study guide

Updated 24 October 2026

Time zones, dates and calendars in system design

Handling time correctly in distributed systems and products: UTC timestamps versus local times, time zone identifiers and daylight saving, scheduling recurring events, business days and local dates, storing durations, clock skew, leap seconds, and testing time-dependent code.

Reading is half of it. Now try it in an interview.An AI interviewer asks you to design Google Calendar, out loud or typed, and scores the answer for your level. Or watch a sample interview first, free with no sign-up to start.
Start an AI mock

Time bugs are among the most common and embarrassing in production: reminders sent at 3 a.m., bookings shifted by an hour after a daylight saving change, daily reports missing a day's data, payments due on a date that does not exist. Designs involving schedules, bookings, reports or notifications should state how they handle time. A few rules prevent almost all of these bugs.

Two different kinds of time

  • Instants: a specific moment, the same everywhere ("the payment was captured at 2026-10-05T12:00:00Z"). Store as UTC timestamps.
  • Local (civil) times: what a person sees on a wall clock in a place ("check-in at 15:00 in Lisbon", "every Monday at 9:00 my time"). Store as a local date or time plus a time zone identifier.

Mixing them up is the root of most bugs. A future local event cannot safely be converted to UTC at booking time, because time zone rules can change before it happens.

Time zone identifiers, not offsets

Store IANA zone names like Europe/Lisbon or America/New_York, not offsets like +01:00. An offset is a snapshot; a zone carries the rules, including daylight saving transitions and historical changes. Governments change rules with little notice, so keep the time zone database updated in every service.

Daylight saving

Twice a year in many zones:

  • Spring forward: some local times do not exist (02:30 may be skipped).
  • Fall back: some local times happen twice (01:30 occurs in two different instants).

Decide what your product does in each case (run at the next valid time; run once, not twice) and use a time library that handles it. Recurring schedules must be computed in local time and converted to UTC for each occurrence, not as "every 24 hours from the first run". See delayed jobs and distributed cron.

Common product cases

CaseStoreNotes
Event log, payments, audit recordsUTC instantdisplay in the viewer's zone
Hotel night, rental check-inlocal date and time plus the property's zonea "night" is a local date, not a UTC range. See bookings and reservations
Recurring reminderlocal time, recurrence rule, user's zonerecompute when the user changes zone
Birthday, due datelocal date with no time"the 5th" should not become the 4th in another zone
Business hoursweekly local schedule plus zoneinclude holidays per region
Daily reportthe business's reporting zone"yesterday" depends on the zone; be explicit
Duration (a 15-minute hold)an elapsed durationnot affected by zones or DST

Daily aggregates

"Daily active users" and "revenue per day" depend on where a day starts. Choose a reporting time zone (often UTC for global metrics, local for per-market reports), document it, and partition data accordingly. Aggregating in UTC and showing it as local days produces numbers that do not match anyone's expectations. See data quality and data contracts.

Scheduling for users

  • Send notifications at a sensible local time in each user's zone, with quiet hours. See push notifications.
  • Spread "9 a.m. everywhere" sends: they become hourly waves as each zone reaches 9 a.m., which naturally smooths load, but large zones still create spikes; add jitter. See Design a Notification System.
  • Recompute schedules when users travel or change their zone.

Money and dates

Billing periods, interest and due dates follow local or contractual calendars: month-end varies in length, the 31st does not exist in every month, and business days exclude weekends and holidays that differ by country. Use explicit rules and a holiday calendar per market. See Design a Payment System.

Machine clocks

Server clocks drift and are corrected by NTP; they can jump backwards. So:

  • Use monotonic clocks for measuring durations and timeouts within a process.
  • Never rely on wall-clock order between machines for correctness; use sequence numbers, logical clocks or a single authority. See unique ids, ordering and time.
  • Leap seconds are usually smeared by cloud providers (spread over hours), but be aware they exist.

APIs and formats

  • Exchange instants as ISO 8601 strings with Z or an explicit offset, or as Unix timestamps with documented units (seconds versus milliseconds is a classic bug).
  • Exchange local dates as YYYY-MM-DD without time, and local times with the zone id alongside.
  • Let clients send their zone; do not guess from IP when it matters.

See API design.

Testing

Inject a clock instead of calling the system time directly, so tests can simulate DST transitions, month ends, leap years and different zones. Test with zones that have half-hour offsets and with dates near transitions. See testing distributed systems.

In the interview

For Design Airbnb: "Nights are local dates in the listing's time zone; check-in times are local times with the zone id; the payment and audit timestamps are UTC instants." For Design a Job Scheduler: "Cron expressions are evaluated in the job's zone with explicit DST rules; each occurrence is computed to a UTC instant for the timer store."

Checklist

  • UTC instants for events; local time plus zone id for human schedules.
  • IANA zone names, updated time zone data everywhere.
  • Explicit DST behaviour for skipped and repeated times.
  • Local dates for nights, birthdays and due dates.
  • A documented reporting zone for daily aggregates.
  • Monotonic clocks for durations; no cross-machine ordering by wall clock.
  • Injected clocks and tests around transitions.

Questions people ask

Should you store dates in UTC or local time?

Store instants, such as payments, events and audit records, as UTC timestamps, and store human schedules as a local date or time plus a time zone identifier. Mixing the two up is the root of most time bugs. A future local event, such as check-in at 15:00 in Lisbon, cannot safely be converted to UTC at booking time, because time zone rules can change before it happens.

Why store a time zone name instead of a UTC offset?

Store an IANA zone name such as Europe/Lisbon or America/New_York rather than an offset such as +01:00, because an offset is only a snapshot while a zone carries the rules. Those rules include daylight saving transitions and historical changes, and governments change them with little notice. That is also why every service should keep its time zone database updated.

How do you handle daylight saving time in software?

Decide explicitly what the product does at each transition and use a time library that handles it. When clocks spring forward, some local times do not exist (02:30 may be skipped); when they fall back, some happen twice (01:30 occurs at two different instants). Typical choices are to run at the next valid time when a time is skipped, and to run once, not twice, when it repeats.

How do you schedule recurring events across time zones?

Store the local time, the recurrence rule and the user's zone, and compute each occurrence in local time before converting it to a UTC instant. A schedule stored as "every 24 hours from the first run" goes wrong across daylight saving changes. Recompute occurrences when users travel or change zone, and add jitter to "9 a.m. everywhere" sends, because large zones still create spikes even though the sends arrive in hourly waves.

How should you store a date without a time, like a birthday?

Store it as a local date with no time, because "the 5th" should not become the 4th in another zone. The same applies to due dates and hotel nights: a night is a local date in the property's zone, not a UTC range, and check-in is a local time plus the property's zone. In APIs, exchange local dates as YYYY-MM-DD without a time.

Can you rely on server clocks to order events?

No: server clocks drift, are corrected by NTP and can jump backwards, so never rely on wall-clock order between machines for correctness. Use sequence numbers, logical clocks or a single authority for ordering, and monotonic clocks for measuring durations and timeouts within a process. Leap seconds are usually smeared by cloud providers over hours, but they still exist.