I have a transformation to make. I am using MomentJS
, and I am trying to take milliseconds
and convert them to the format 1 Hour and 7 Mins
for example.
I can make it work like this 1,1 Hours with the following code, where interval
is the time in ms:
moment
.duration(interval)
.asSeconds()
.toFixed(0)
How can I make this work. Take ms
and transform them into human-readable formats.
By the way, I tried the
humanize
method, but didn't cover them. Just FYI..