Skip to content
Web Design & Development

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.

MediaScaleUp Editorial Team 2 min read 14 views
A Practical Guide to Dates, Times and Time Zones

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
What to do and what to avoid with dates, times and time zones, side by side
Good practice against the usual mistakes, from the sources listed below.

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

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.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development