//seconds in number -> toObj ? {h,m,s} : [hh:]mm:ss functionconvertSecNoToHMS(seconds, toObj) { toObj = toObj || false seconds = ~~seconds var h = ~~(seconds / 3600), m = ~~((seconds % 3600) / 60), s = seconds - h * 3600 - m * 60 h = h < 10 ? '0' + h : h m = m < 10 ? '0' + m : m s = s < 10 ? '0' + s : s return toObj ? { h: h, m: m, s: s } : (+h ? h + ':' : '') + m + ':' + s; }