A
A
azaryanlena2021-12-03 02:21:47
API
azaryanlena, 2021-12-03 02:21:47

In what format should the date and time parameter (departure_time/arrival_time) be specified in the Google Get directions API?

Hello.
What is the correct way to specify the value for the date and time parameter in json format? How to convert date/time/time zone to acceptable json format (integer in seconds since midnight, January 1, 1970 UTC)?
Attached parameter description:
departure_time (same for arrival_time)

Specifies the desired time of departure/arrival. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. If a departure_time later than 9999-12-31T23:59:59.999999999Z is specified, the API will fall back the departure_time to 9999-12-31T23:59:59.999999999Z. alternatively, you can specify a value of now, which sets the departure time to the current time (correct to the nearest second)
https://developers.google.com/maps/documentation/d...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question