Today in the actual combat encountered small problems, worth recording:

TimeToSec (time) {var hour = time.split(':')[0] var min = time.split(':')[1] var SEC = time.split(':')[2] var S = Number(hour * 3600) + Number(min * 60) + Number(SEC) return s * 1000} secTotime(s) {var t = "; if(s > -1){ var hour = Math.floor(s/3600) var min = Math.floor(s/60) % 60 var sec = s % 60 if(hour < 10) { t = '0'+ hour  + ":" } else { t = hour + ":" } if(min < 10){ t += "0" } t += min + ":" if(sec < 10){ t += "0" } t += sec.toFixed(2) } return t }Copy the code