I am using distant matrix api to get the travel time between 2 points and I want to consider the traffics when calculating the travel time, I am calling the distance matrix while passing this URL as part of the request :
"https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&" +
"origins=" + startLat +"," + startlong +
"&destinations=" + endLat +","+endLong +
//departure_time parameter
"&departure_time=now" +
"&key=my api key");
According to the documentation adding the departure_time parameter to my request will add the travel time data while considering traffics (in the URL above I am using the parameter as the request is sent).
I want to pass some time in the future as the departure_time parameter
After reading the documentation it seems like I need to pass the time as int/long, (for example departure_time=1399995076).
Here is some time for example = 21:15 lets say on friday.
How can I convert this time or any time into int/long?
I have looked at this answer and many more related to the subject but none of them helped me.