/ Published in: JavaScript
to_text( int ) -- the int is the number of seconds.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function to_text( s ) { var second = s % 60; var hour = Math.floor( (s/60) / 60 ); var minute = Math.floor( (s/60) % 60 ); return hour + 'h ' + minute + 'm ' + second + 's'; }