I have an asp.net-mvc
application that makes it possible to schedule appointments with people all over the world. Those appointments are all saved in UTC
format in the database. During registration the users have selected the time zones they live in. So all appointments are displayed in their time zone.
That being said, here is the situation. If a user that lives in the time zone W. Europe Standard Time
wants to make an appointment with someone living in the time zone Eastern Standard Time
the first of May (01-may-2014) at 1 O'clock in the afternoon until 5 O'clock in the afternoon.
The time will be converted to UTC
format and compared with existing appointments in the database whether it's possible or not (for example, the user doesn't have another appointment). And if it's possible, the appointment gets persisted into the database for both users.
Now here comes the interesting part. The user living in W. Europe Standard Time
will see 1 O'clock - 5 O'clock (both in the afternoon) in his schedule, while the user living in Eastern Standard Time
will see 7 O'clock - 11 O'clock in the morning (7 hours of difference between time zones) in his schedule.
This happens because the appointments are all converted from UTC
to the user's time zone when they check their schedule in the view.
So the question is, how can I make sure that both users get the same time for an appointment they made with each other?