$.getJSON("api/times", function(times) {
var time1 = times.departure; // 14:36:30 (string)
var minutesToAdd = parseInt(times.minutesToAdd); // 6
var total = "?"; // How can I add minutesToAdd to time1?
});
I am trying to parse time1
so that I can add the minutesToAdd
value to the time. The time1
value comes directly from a MySQL database. It is obtained through an API that returns this data in JSON. How can I do this?