1

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.

rafon
  • 1,469
  • 11
  • 21
Jitendra Kumawat
  • 133
  • 1
  • 2
  • 12

2 Answers2

0

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).

rafon
  • 1,469
  • 11
  • 21
  • Thanks for you reply. I guess you referring to google places api which again required other parameters like place_id , i was thinking google geocoding api could have return timezone or utc_offset along with longitude and latitude. – Jitendra Kumawat Oct 12 '17 at 19:02
0

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.

EmrahYT
  • 71
  • 5