秒转为时分秒格式
function formatSeconds(value) { if(value == undefined) { value = 0; } var second = parseInt(value);// 秒 var min = 0;// 分 var hour = 0;// 小时 if(second > 60) { min = parseInt(second/60); second = parseInt(second%60); if(min > 60) { hour = parseInt(min/60); min = parseInt(min%60); } } var result = ""+parseInt(second)+"秒"; if(min > 0) { result = ""+parseInt(min)+"分"+result; } if(hour > 0) { result = ""+parseInt(hour)+"小时"+result; } return result; }