Ayush Goswami Ayush Goswami - 1 year ago 166
Javascript Question

How to use moment js to convert "hh:mm:ss" time format into hours, minutes, seconds?

For example, I have a time string in the form "00:30:00", so the output should be 30 minutes. Or if we have "15:00:30", so the output should be 15 hours 30 seconds.
Can it be done using moment? or do I need to write my own code?

Answer Source

Here is a post that can help you: http://stackoverflow.com/a/21840646/4573534

All you need to do now is to parse hh:mm:ss to milliseconds

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download