Quantcast
Channel: JavaScript seconds to time string with format hh:mm:ss - Stack Overflow
Viewing all articles
Browse latest Browse all 49

Answer by Harish Ambady for JavaScript seconds to time string with format hh:mm:ss

$
0
0

You can manage to do this without any external JS library with the help of JS Date method like following:

var date = new Date(0);date.setSeconds(45); // specify value for SECONDS herevar timeString = date.toISOString().substring(11, 19);console.log(timeString)

Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>