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.
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.