Skip to content Skip to sidebar Skip to footer

How Can I Display Time With Leading Zeros?

I have created a time function to calculate time as media is playing. It does not display any leading zeros. How can I make it display any leading zeros? function converttoTime(ti

Solution 1:

this should work:

var time=('0'  + minutes).slice(-2)+':'+('0' + seconds).slice(-2);

Post a Comment for "How Can I Display Time With Leading Zeros?"