//If you want to tranform this 90m to this 1h30m ..do this var totalTimeInMinutes = 90; var hour = Math.floor(totalTimeInMinutes / 60); //1h var minutes = totalTimeInMinutes - (hour * 60); //30m