var data = {
"duration": {
"value": 74384,
"text": "20 hours 40 mins" //convert this to a valid time date format
},
"distance": {
"value": 2137146,
"text": "1,328 mi"
},
}
Done few sample test:
var date = new Date(Date.parse(data.duration.text));
var date = moment(new Date(data.duration.text));
reference: https://developers.google.com/maps/documentation/directions/intro#UnitSystems