0

Alice lives in Russia(GMT+7). Bob lives in Alaska(GMT-8). They are relatively close, and less than 200 miles apart. https://www.google.com/maps/@55.5067319,-173.8489655,3z

Alice and Bob should meet at noon based on an average of their Time Zones so both people are inconvenienced as little as possible. If we average GMT+7 with GMT-8, we come up with GMT-0.5.

This does not work because calculating noon based on GMT-0.5 would be closer to midnight for both, rather than noon because the time zones are calculated linearly instead of circularly.

Does anyone know of a library which can solve Alice, Bob's problem, and also allow Charlie and Dave to join the meeting?

AdamOutler
  • 870
  • 4
  • 13
  • 29
  • It doesn’t seem to me the math would be very complicated. I agree in preferring a library if a reliable one exists (which I don’t know). What did your search turn up? – Ole V.V. Jul 23 '18 at 18:34

1 Answers1

1

Your GMT-0.5 average is wrong, because to get the time difference we have to take into account the 24 hour cycle and the fact that GMT is half way between both ends of the range.

GMT+0700 is 15 hours ahead of GMT-0800, but as 15 is greater than 12 (more than half way round the Earth) the shortest time difference is actually 9 hours, but on different days.

That maths is pretty easy. In pseudo code:

offset = abs( 7 - -8 )
if offset > 12 then offset = 24 - offset

Gives offset == 9.

So the closest times to local noon for both parties would be 4.5 hours before noon for Alice in Russia (07:30am) and 4.5 hours after noon for Bob in Alaska (16:30pm) but on the previous day because Russia is in the future!

This half way point would be an imaginary time offset we can call GMT+1130, so Bob and Alice would arrange to meet at 00:30 GMT.


For comparison: timeanddate.com has a meeting planner. It rounds to the hour and gives the best overlaps for Krasnoyarsk and Anchorage as 8am/5pm.

See https://www.timeanddate.com/worldclock/meetingtime.html?iso=20180724&p1=372&p2=18


Academic side point: these two timezones are not a mere 200 miles from each other. They are thousands of miles apart. The eastern point of Russia is actually 12 hours ahead of GMT.

Tim
  • 8,036
  • 2
  • 36
  • 52