0

I'm building an ASP web app that stores appointment times; it'll be used in different timezones. I'm currently saving an appointment in the database as a datetime field. Do I also need to add a field to save the timezone? What's the best option to solve these multi-timezone issues?

Thanks.

JasCav
  • 34,458
  • 20
  • 113
  • 170
frenchie
  • 51,731
  • 109
  • 304
  • 510
  • http://stackoverflow.com/questions/179834/what-is-the-best-way-to-detect-and-store-the-timezone-the-client-of-a-web-app-is and http://stackoverflow.com/questions/11975/handling-timezones-in-storage – Egor Pavlikhin Jan 11 '11 at 04:14

1 Answers1

0

Most common approach is to save all date/times as UTC in the database, then apply a user specific timezone offset to them when displaying them.

If I am in GMT+10, and I choose 10:00 AM as a time for a certain event, store the time in the database as midnight.

When a GMT+5 person comes to view the site, get the UTC time out of the database and add their offset to it (5 hours) to display the time at 5:00 AM.

Michael Shimmins
  • 19,961
  • 7
  • 57
  • 90