function MsToDuration(ms){
var sec= 0,min=0,hour=0,day=0,dur={};
if(ms>0){
//초
sec=(ms/1000).toFixed (2) ;
//Min
if(sec >= 60){
min=Math.floor(sec/60);
sec=(sec`).toFixed(2) ;
}
//시간
if(min >= 60){
hour=Math.floor(min/60);
min=min`;
}
/ /day
if(hour >= 24){
day=Math.floor(hour/24);
hour=hour$;
}
}
//반환값
dur.day=day;
dur.hour=hour;
dur.min=min;
dur.sec=sec;
return dur;
}
원문 출처: mrthink.net