0

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?

Quoter
  • 4,236
  • 13
  • 47
  • 69
  • 1
    I'm confused, isn't seeing different hours, which actually correspond to the same times what you want? – svick Apr 21 '14 at 23:38
  • You probably *don't* want to schedule appointments by UTC. See [here](http://stackoverflow.com/a/22080372/634824) and linked responses from there. – Matt Johnson-Pint Apr 22 '14 at 00:44
  • @MattJohnson, I found your post on this link: http://stackoverflow.com/questions/19166995/java-calendar-date-and-time-management-for-a-multi-timezone-application/19170823#19170823 very useful, especially your 2nd point. Any chance you can elaborate that for me in my situation? I do have events being scheduled in the future, and the times are saved in UTC format. But in the view they are displayed in the local time of the user (I have their time zone saved in the database). A small quote from you: "Instead, you should store two values" (taken from your post on that link). – Quoter Apr 22 '14 at 10:31
  • @svick, it is confusing, isn't it? This bothered me for a few weeks until I decided to ask my fellow developers. But to get back to your question, the event will take place face 2 face. When that happens, seeing different hours is very confusing for both party's. – Quoter Apr 22 '14 at 10:40
  • If I understand correctly, you're saying you'd like an appointment that's scheduled for 10:00 AM to *always* show 10:00 AM regardless of who's looking at it? If you're going to do that, then you should be very clear about what time zone that appointment is in. But you should understand that in the vast majority of cases, end-users expect the appointment time to be adjusted to *their own* time zone, regardless of what time zone it was scheduled in. – Matt Johnson-Pint Apr 22 '14 at 16:47
  • I'm beginning to think this is akin to asking for [7 perpendicular lines](https://www.youtube.com/watch?v=BKorP55Aqvg). – Matt Johnson-Pint Apr 22 '14 at 16:49

3 Answers3

1

If you want them both to see the same time displayed, then show both of them the schedule in UTC time, and they'll see the same thing.

If you want them to see a time they'll understand, then show them both the appointment time in their own time zone and accept that it'll display differently for users in different time zones.

Eric King
  • 11,594
  • 5
  • 43
  • 53
0

Its just impossible, they live in different time zones, when A is at 17:00 B can be at 21:00, so its normal that an appointment has different times if it must happen simultaneously in different time zones.

Gusman
  • 14,905
  • 2
  • 34
  • 50
0

If the meetings you're talking about is not virtual (like a Skype call), but physical, then it also has a physical location. That means that the location, or at least its time zone, should one of the parameters of the appointment.

Then you can show both participants the same time, in the time zone of the meeting location, and ignoring the time zones in their preferences. But to avoid confusion, I would also explicitly show the time zone of the meeting.

svick
  • 236,525
  • 50
  • 385
  • 514