algorithm for getting time zone from geo coordinates

前端 未结 4 1426
春和景丽
春和景丽 2021-01-02 03:15

I want to write app where user can point any place on map (not only cities) and get timezone in that place.

What data structure (app will not have Internet connectiv

4条回答
  •  渐次进展
    2021-01-02 03:37

    Joel Neely's answer is good, but be aware this is a really tricky problem for political reasons. So for disputed areas like Kashmir or Tibet you could offend people by the decision you make.

    Also, if you want to then use timezone information to compute time changes it gets even trickier, as decisions about whether Daylight saving time is used, and the date it changes can change with only 2 weeks notice. See: http://www.timeanddate.com/news/time/argentina-dst-2009-2010.html

    The polygon information can be bought at http://www.worldtimeserver.com/time_zone_guide/ if you are interested. Disclaimer - I haven't bought this information, so don't know how good it is.

提交回复
热议问题