Prompt
How do I make scheduling work across time zones?
Latest observation
To make scheduling work across time zones, the key is to store times in a neutral form and convert them only for display and user interaction.
Core rules
-
Store the event in UTC
- Keep the canonical timestamp in UTC in your database.
- Example:
2026-10-16T15:00:00Z
-
Also store the intended time zone when needed
- If the event is tied to a local wall-clock time, store the zone too.
- Example: “Every day at 9:00 AM America/New_York”
- This matters for recurring events and daylight saving time.
-
Convert to the user’s local time zone when displaying
- Use the user’s browser/device time zone or their saved preference.
- Example:
15:00 UTCmight display as11:00 AMin New York or8:00 AMin Los Angeles.
-
Never do business logic in local time unless that’s the requirement
- Use UTC for comparisons, sorting, and calculations.
- Convert only at the edges: input and output.
Common cases
One-time meetings
- User picks a local time and time zone.
- Convert that to UTC before saving.
- Show it in the viewer’s time zone afterward.
Example:
- User schedules
March 10, 9:00 AMinEurope/London - Save as UTC equivalent
- When viewed elsewhere, convert appropriately
Recurring events
Recurring events are trickier because local time may shift with daylight saving.
If the rule is:
- “Every Monday at 9:00 AM New York time”
Then store:
- recurrence rule
- event time zone:
America/New_York
Do not just store UTC, because 9:00 AM local will not always equal the same UTC time throughout the year.
Daylight saving time pitfalls
DST causes:
- skipped times (e.g. 2:30 AM may not exist on spring forward)
- repeated times (e.g. 1:30 AM may occur twice on fall back)
You need to decide how to handle these:
- reject invalid local times
- shift to the next valid time
- choose the earlier/later occurrence for repeated times
Make this behavior explicit in your app.
Recommended data model
For a single event:
start_utcend_utctime_zone(optional but useful)
For recurring events:
recurrence_rulelocal_start_timetime_zone
Implementation tips
-
Use standard timezone libraries:
- JavaScript:
Intl.DateTimeFormat,Temporalpolyfill, Luxon, date-fns-tz, Moment Timezone (legacy) - Python:
zoneinfo,pytz(older),dateutil - Java/Kotlin:
java.time - .NET:
DateTimeOffset, NodaTime
- JavaScript:
-
Avoid storing naive datetimes without a zone.
-
Use IANA timezone names like:
America/New_YorkEurope/BerlinAsia/Tokyo
Practical UX recommendations
- Show the time zone alongside the time.
- Example:
9:00 AM EDT
- Example:
- Let users choose their preferred display zone.
- For scheduling, show a timezone selector near the time input.
- If the event’s zone differs from the viewer’s zone, make that obvious.
Simple mental model
- Store in UTC
- Schedule in a specific timezone
- Display in the viewer’s timezone
If you want, I can also give you:
- a database schema for this
- example code in JavaScript/Python/SQL
- guidance for recurring meetings and DST edge cases