another great way const measuredTime = new Date(null); measuredTime.setSeconds(17938); const MHSTime = measuredTime.toISOString().substr(11, 8); "04:58:58"
@@abdelrahman5094 substr(11,8) = Substr(skipallnumbersbeforethisnumber, Outputcharacterslength)).....If you "console.log" this ""const measuredTime = new Date(null); measuredTime.setSeconds(17938); const MHSTime = measuredTime.toISOString()."; you will get this "2020-06-22T10:28:58.918" Because we want to removed "2020-06-22T" and only want to have result in "10:28:58" .Therefore we use "substr(start,lenght)"..substr() will substract all starting numbers and give us result in 8 characters."substr(11.8)..
I wrote a function that takes in seconds' result and returns totalVidTime. Great video! learning a ton with this series. function totalVidTime(seconds){ let hours =Math.floor(seconds/3600); let minutes =Math.floor((seconds/3600%1)*60); let secnd = Math.floor(((seconds/3600%1*60)%1)*60); return `${hours}:${minutes}:${secnd}`; }