• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can anyone help me in JavaScript ?

chocobaR

Golden Member
I need to write a program that when a user puts let's say 12537 seconds, it has to tell him what it is in hours, minutes and seconds.

12537 seconds --> 3 hours 28 minutes 57 seconds

Thanks.
 
function makeTime(seconds) {
var num = seconds;
var hour, minute, second;
if (num) {
num /= 3600;
hour = parseInt(num);
num -= parseInt(num);
num *= 60;
minute = parseInt(num);
num -= parseInt(num);
num *= 60;
second = parseInt(num);
}
}
 
Back
Top