Исправление uin, (текущая версия) :
Не, ну я то имею в виду такие вещи как например
function (ms) {
var s, m, h;
s = Math.floor(ms) % 60;
m = Math.floor(ms / 60) % 60;
h = Math.floor(ms / (60 * 60));
return {
seconds: s,
minutes: m,
hours : h
}
}
var x = Math.floor(ms),
s = x % 60, h = 0,
m = Math.floor(x / 60);
if (m > 59) {
h = Math.floor(m / 60);
m %= 60;
}
Исходная версия uin, :
Не, ну я то имею в виду такие вещи как например
function (ms) {
var s, m, h;
s = Math.floor(ms) % 60;
m = Math.floor(ms / 60) % 60;
h = Math.floor(ms / (60 * 60));
return {
seconds: s,
minutes: m,
hours : h
}
}
var x = Math.floor(ms),
s = x % 60, h = 0,
m = Math.floor(x / 60);
if (m > 59) {
h = Math.floor(m / 60);
m %= 60;
}