2

As it is mentioned on The Google Maps Distance Matrix API - departure time is used to receive trip duration considering current traffic conditions.

I tried to get time between points in different days for example: Fri, 02 Oct 2015 14:10:45 GMT Friday Calculation and in the response duration is 22 min

When I set date with less traffic Sun, 04 Oct 2015 01:10:45 GMT Sunday Calculation the response duration is again 22min.

I think the time durations should be different if in calculations are considered current traffic!

duncan
  • 31,401
  • 13
  • 78
  • 99
  • 1
    Yes it probably should. According to [the documentation](https://developers.google.com/maps/documentation/distance-matrix/intro#RequestParameters) though _"Google Maps API for Work customers can specify the departure_time to receive trip duration considering current traffic conditions."_ Are you a Google Maps API for Work customer? – duncan Oct 01 '15 at 11:55

1 Answers1

1

Just set departure_time=now in your query options. note now shouldn't be specified as a timestamp. You will see a response with duration_in_traffic as a child to the elements tag or keyword

stry-kai
  • 483
  • 4
  • 7