Question:
I am writing an application for both platforms, in which it is vital to know the current exact time in a certain city, for example, Novosibirsk.
The time zone has recently changed, and the clocks are also switched to winter and summer … In general, it is not always equal to GMT + 7. And you need to know exactly the correct time in the city, regardless of what is set on the user's device.
Are there any resources from which you can parse the exact time in a particular city or libraries with such a function …
In general, is there any single correct solution in this situation?
(android: I know how to use Jsoup, parsed time from http://www.epochconverter.com/ , but the site is sometimes unavailable, which means this option is not suitable)
I would be grateful for any useful information!
Answer:
I used google maps. Through the API https://maps.googleapis.com/maps/api/timezone/json , you can access the current time zone at the specified coordinates (including time translation). The city coordinates are easy to get by name.
Here is the documentation:https://developers.google.com/maps/documentation/timezone/intro
Pay attention to the dstOffset and rawOffset parameters.