The minuites and hour dont seem to be correct, I need he minute to not be more than 60. Thanks a lot
counter = 0;
var timeleft = 36070;
function leftPad(number, targetLength) {
var output = number + '';
while (output.length < targetLength) {
output = '0' + output;
}
return output;
}
function covertSeconds(s){
var hrs = Math.floor(s/3600);
var min = Math.floor(s/60);
var sec = s% 60;
return leftPad(hrs,2) +":" + leftPad(min,2) + ":"+ leftPad(sec,2)
}
var timer = $("#timer").text(covertSeconds(timeleft - counter));
function timeIt(){
counter ++;
timer.text(covertSeconds(timeleft - counter));
};
setInterval(timeIt, 1000)