I've been going through the docs and I'm not sure what I'm doing wrong. I need to convert 7200
to 2:00:00
. Seems easy? Some attempts:
var duration = 7200;
var display = moment().seconds(duration).format("h:mm:ss");
and...
var duration = 7200;
var display = moment.duration(duration, "seconds"); //can't chain on a format method?
The format comes back correct but the numbers are all wrong. If I use a duration of Math.round(7025.526)
or 7025.526
I get 9:19:06
back.
How can I convert seconds to h:mm:ss
successfully?