A Practical Guide to Dates, Times and Time Zones
Storing, calculating and displaying dates and times correctly for users in different time zones, including daylight saving changes.
On this page
At a glance
- Storage convention store timestamps in UTC
- Time zone data the IANA time zone database, such as America/New_York
- Format for exchange ISO 8601
- Display Intl.DateTimeFormat formats dates for a locale and time zone
Why it matters
Why it matters: Time zone bugs cause missed appointments, wrong order dates and broken reports, and they often only appear twice a year when clocks change.
Best practice
- Store instants in UTC and convert for display
- Store the user's time zone where it matters
- Use IANA zone names, not fixed offsets
- Test around daylight saving transitions
- Show time zones on bookings and events
Common pitfalls
Watch out for:
- Storing local times without a zone
- Fixed offsets that ignore daylight saving
- Parsing ambiguous date strings
- Assuming every day has 24 hours
When to call in a specialist
Bottom line Bring in help when building booking, scheduling or reporting features used across time zones.
Where this comes from
- MDN Web Docs — Intl.DateTimeFormat
- MDN Web Docs — Date
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.