Skip to content
Advertisement

javascript parse time (minutes:seconds) from milliseconds

How to parse a given amount of milliseconds (e.g. 125230.41294642858) into a time format like: minutes:seconds?

Advertisement

Answer

var ms = 125230.41294642858,
   min = 0|(ms/1000/60),
   sec = 0|(ms/1000) % 60;

alert(min + ':' + sec);
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement