Type/to search
8
Follow
1392
Followers
Kod Praktikal JavaScript - Tukar milisaat kepada panjang masa yang boleh dibaca
FAQ
Created 2018-04-24 15:21:28  Updated 2018-04-24 15:21:55
 0
 2093

Kod kecil berguna

Ubah milidetik ke masa baca

function MillisecondToDate(msd) { var time = parseFloat(msd) / 1000; if (null != time && "" != time) { if (time > 60 && time < 60 * 60) { time = parseInt(time / 60.0) + "分钟"+ parseInt((parseFloat(time / 60.0) - parseInt(time /60.0)) *60) +"秒" }else if (time >=60 * 60 && time < 60 * 60 * 24) { time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) + "分钟" + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒" }else { time = parseInt(time) + "秒" } }else{ time = "0 时 0 分0 秒" } return time }
Related Recommendations
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)