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?
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