Course contentsShow
← Web Development
Lesson 2756 of 2,98249. Dates, Times, and Numbers on the WebFree lesson

Calendar Events Across Timezones

Handle the complexity of scheduling events for users in different timezones, including recurring events.

Calendar Events Across Timezones

You'll learn how to handle the complexity of scheduling events for users in different timezones, including recurring events.

The Challenge

When building calendar or scheduling applications, you're not just dealing with a single user's timezone—you're coordinating events where participants might be scattered across continents. An event scheduled for "3 PM Thursday" means something completely different to someone in New York versus Tokyo.

Core Principles

Store in UTC, display in local. Your database should always store event times in UTC. When displaying to users, convert to their timezone using the techniques you've learned (like Intl.DateTimeFormat with the timeZone option or Luxon).

Store the original timezone. For events created by a specific user, save which timezone they were in when scheduling. This matters because "3 PM Berlin time" should stay "3 PM Berlin time" even if daylight saving time transitions happen before the event occurs.

Recurring events are especially tricky. A weekly meeting at "9 AM Pacific" must adjust its UTC representation when daylight saving time changes—otherwise it shifts an hour for participants in timezones without DST. Your recurrence logic needs to generate each instance relative to the original timezone, not by adding fixed UTC intervals.

The Pattern

Think of it like international mail: you write the address in the recipient's format (their timezone), but the sorting facility (your server) processes everything in one standard system (UTC). When the package arrives, it's translated back to local context.

For events with multiple participants, show each person the time in their own timezone, but include the original timezone as context: "3:00 PM CET (9:00 AM EST for you)."

Key Takeaway: Store event times in UTC along with the original timezone, generate recurring instances relative to that timezone to handle DST correctly, and always display times converted to each user's local timezone.