А вот как показал
exec, конечно, изящнее:
x = 123123;
alert(Math.floor(x / 3600) + " : " + (Math.floor(x / 60) - (Math.floor(x / 3600) * 60)) + " : " + x % 60);
И чего я в этот Math.floor сразу не врубился?
Мне показалось, что он как-то «не так» округляет.
Дудачёк
