'How to get TimeZone, latitude and longitude using single Google API Call

I have address(city,state,country,zip) and want to get TimeZone , latitude and longitude in single Google API call , i see google provide TimeZone api which accepts latitude and longitude and returns TimeZone but that requires two api call , first is to get location ( lat/lng) and second call to get TimeZone from location , not sure if google provide such api which can solve this problem in single call.



Solution 1:[1]

I believe you can at least get the number of minutes this place's current timezone is offset from UTC together with its coordinates using Place Autocomplete. You can look for the logs 'utc_offset' under 'result' property.

The response includes the following:

geometry: The place's geometry-related information. This includes: location provides the latitude and longitude of the place. viewport defines the preferred viewport on the map when viewing this place.

utc_offset: contains the number of minutes this place’s current timezone is offset from UTC. For example, for places in Sydney, Australia during daylight saving time this would be 660 (+11 hours from UTC), and for places in California outside of daylight saving time this would be -480 (-8 hours from UTC).

Solution 2:[2]

You can use Places Autocomplete as @rafon said. But you should use setFields method and add utc_offset_minutes.

Like that autoComplete.setFields(['utc_offset_minutes'])

You can not get utc_offset_minutes from geocoding api.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rafon
Solution 2 EmrahYT