var num = 69697 var S = num % 60 var M = (num - S) / 60 % 60 var H = (num - S - 60 * M) / 3600 console.log(H, M, S);