$.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 need to manipulate the time1
variable in order to add the value of minutesToAdd
to it. The initial value of time1
is retrieved from a MySQL database and obtained through an API that provides the data in JSON format. What would be the best approach to achieve this?