Astroproject’s Blog


Automatic calculation of time zones

14 Dec 2018

Realized automatic calculation of time zones for all localities that are in the database (about 8500), since about 1915 (depends on the city). With time the list of cities will expand!

Initially, I planned to manually transfer the data from Anatoly Zaitsev and Denis Kutalev's guide "City coordinates and time amendments", but already on the 2nd day I understand that it was not mine, my nature rebelled so that it could be reprinted 8 hours a day, so much time within a month and a half I would have to spend on this work! At what cities it would be far from 8500 and, as it turned out, the reference book is far from perfect in terms of accuracy, so I acted like a real programmer - I wrote a program code that collected all the necessary data, although it was not done without manual verification.

The accuracy of the data is high, but I understand that for now you cannot be 100% sure that the data is correct, so that the time zone database tends to be as accurate as possible, in case of automatic detection of the time zone, the "Report incorrect time zone" link will appear, clicking on which you can specify the correct time zone - I will consider all these requests manually. If the time zone for the locality has already been specified and, due to a change in the time it has been changed, you will not be left in the dark: an additional notification text will appear, for example: the time zone is changed from +6 to +7. I tried to take into account all the possible nuances.

If the time of birth is at the border of the clock to summer time or vice versa (within 3 hours), in rare cases the "Specify time zone (border of clock transfer)" link will appear on the site, where it’s not the locality itself that is displayed, but the time zone in which it is located, which allows you to specify data up to 1800. And if the time zone is not automatically detected, the "Find a time zone on" link will appear, where you can specify the place of birth in the search field, find the time interval where the birth time falls, and take the time zone from the "Offset After" column.

When selecting a locality, now for convenience, the "Find a localiity on Wikipedia" link is also displayed - for cases where the required one is missing. In Wikipedia, on the page of the locality in the upper right corner its coordinates are displayed and, in addition, Wikipedia, unlike Yandex.Maps, which I also thought about, in the case of identical localities, they will be displayed on the page, divided by countries, where you can select necessary.