自己写的,有问题欢迎指正,有更好的方法欢迎指导
//根据分钟--计算天、小时、分
minuteToDate:function(time){
var day =0;
var hour =0;
var minute =0;
if(time>1440){//分钟数大于一天
day =parseInt(time/1440);
var hafDay = time%1440;
if(hafDay>60){//分钟数大于一小时
hour =parseInt(hafDay/60)
minute = hafDay%60;
}else{
minute = hafDay
}
}else{//分钟数小于一天
if(time>60){
hour =parseInt(time/60);
minute = time%60;
}else{
minute = time;
}
}
var result = day+"天"+hour+"小时"+minute+"分钟";
return result;
}
网友评论