0
votes

I'm working with Google Distance Matrix API. If anybody can help, I would like to know how to specify the departure time in the link in JSON format. For example:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=32.547235,-116.992427&destinations=33.7589%2C-118.2385%7C&mode=driving&departure_time=now&traffic_model=optimistic&key=AIzaSyB09BHTF0p2nuhX_pV_c_6FyUs330tWvTE

Say, I want to get the distances and durations from the two coordinates in the link above @1pm 2pm 3pm 11pm on July 26th 2016, what should I write in the departure time?

Thank you very much in advance,

1

1 Answers

1
votes

There is an optional parameter labeled "departure_time" under the Google Geo API available. You should try that out... it's in UTC so "you can specify the time as an integer in seconds since midnight, January 1, 1970 UTC."

src: https://developers.google.com/maps/documentation/distance-matrix/intro#DistanceMatrixRequests

Happy coding! :)