There are coordinates:

Address:Ufa, Republic of Bashkortostan, Russia Latitude:54.8098660 Longitude:56.0939110 

How can I calculate the time zone? Is there a formula?

//specialist. calculation services are not needed.

  • four
    The boundaries of time zones pass through the watersheds, the boundaries of regions and edges, and God knows how - how do you imagine the formula? Push The Tempo%) - pshentsoff
  • 3
    Particularly interesting is the part of the formula where the legislation will be taken into account)) for example, the fact that the transition to winter time was canceled in Russia;) - thunder
  • four
  • one
    @thunder: you can, you need to authenticate -ltelepathy . - VladD
  • 2
    @VladD skipped this subject at school, thought it would not be useful ... in vain ... :) - thunder

3 answers 3

There is no logic in the distribution of zones, respectively, there is no formula either. Use the time zone database: http://www.iana.org/time-zones

Since changes occur from time to time (for example, summer time can be entered and canceled), you will have to update the base regularly.


PS: here is an example of the code that works with the table: http://edoceo.com/exemplar/php-timezone.


PPS: To display the coordinates in the name of the country, advise the database: http://download.geonames.org/export/dump/

  • take note - Gedweb
  • I tried with these databases, namely with tzdata2012 hashcode.ru/questions/192604/… did not work ... something I do not catch up with ((( morfei

Google knows everything, just ask him the right questions: http://ws.geonames.org/timezone?lat=54.8098660&lng=56.0939110

  • 2
    useful stuff, thanks. - thunder

http://askgeo.com/ - ready-made libraries for Java and .NET