"Andrew" wrote:
How can I convert seconds to hh:mm:ss format?
e.g. 123456s = 34:17:36
Number.prototype.pad = function(d) {
var val = String(this)
d = Math.max(d,val.length)
for (var i=0; i<d; i++) val = "0" + val
return val.substring(val.length-d)
}
var seconds = 123456,
hh = Math.floor(seconds/3600),
mm = Math.floor(seconds%3600/60),
ss = seconds%60
return hh.pad(2) + ":" + mm.pad(2) + ":" + ss.pad(2)
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.