日期:2014-05-16 浏览次数:20375 次
function formatSeconds(value) { var theTime = Number(value); var theTime1 = 0; var theTime2 = 0; //alert(theTime); if(theTime > 60) { theTime1 = Number(theTime/60); theTime = Number(theTime%60); //alert(theTime1+"-"+theTime); if(theTime1 > 60) { theTime2 = Number(theTime1/60); theTime1 = Number(theTime%60); } } var result = ""+theTime+"s"; if(theTime1 > 0) { result = ""+parseInt(theTime1)+"m"+result; } if(theTime2 > 0) { result = ""+parseInt(theTime2)+"h"+result; } return result; }