Reputation: 3370
My value is 60.02
so how can I transform it in hours:minutes:seconds.milliSeconds format to get 00:01:00.02
format using the momentJS library?
Upvotes: 0
Views: 462
Reputation: 1458
You could use moment duration to format your time string
let seconds = '60.02';
moment.utc(moment.duration({
seconds: seconds
}).asMilliseconds()).format('HH:mm:ss:SS');
For the whole moment duration docs see here
Upvotes: 3