1 function minute (75) { 2 if (MM < 0) { 3 return '' 4 } 5 var ss = MM % 60 6 ss < 10 ? (ss = '0' + ss) : ss 7 var hh = Math.floor(MM / 60) 8 hh < 10 ? (hh = '0' + hh) : ss 9 var time = hh + ':' + ss 10 console.log(time) //01:15 11 }
标签:10,ss,分钟,60,MM,hh,var,小时,js From: https://www.cnblogs.com/wengg/p/17206813.html