And on google maps site they have a warning about changing time zone at destination: image with time zone warning
I want to make the same warning, but can't find "time zone field" in response from Directions Service.
Question: is there a way to get time zone from google maps api Directions Service in DRIVING MODE (NOT TRANSIT) ? https://developers.google.com/maps/documentation/javascript/directions
The feature is currently not available for Directions API, however, you may file a Feature Request in the Issue Tracker and share your use case so the engineers can review the feasibility of the feature.
As a workaround, what you may do is scan the results of the request then look for strings like "Passing through Idaho Entering Washington", this way, you'll know that a boundary has been crossed, you may then call a Timezone API request to return the timezone information.
for this sample request:
Origin: Roundup, MT 59072, USA
Destination: 2945 Jacklin Rd, Victoria, BC V9B 5E3, Canada
URL Request:
https://maps.googleapis.com/maps/api/directions/json?origin=Roundup%2C%20Montana%2059072%2C%20USA&destination=2945%20Jacklin%20Rd%2C%20Victoria%2C%20BC%20V9B%205E3&mode=driving&key=YOUR_API_KEYIf you inspect the result, you will see in the
html_instructionthere will be instructions:and
This will be your basis on whether a timezone has been crossed, but please also note that this may not be very reliable. I would still suggest that you file a Feature Request for this.