尤其是撥html5 video
function formatSecond(secs) { var hr = Math.floor(secs / 3600); var min = Math.floor((secs - (hr * 3600)) / 60); var sec = parseInt( secs - (hr * 3600) - (min * 60)); while (min.length < 2) { min = '0' + min; } while (sec.length < 2) { sec = '0' + sec; } if (hr) hr += ':'; return hr + min + ':' + sec; }參考網址 點我