Convert HH:MM:SS to seconds in momentjs
Try something like this:
moment('12:10:12: PM', 'HH:mm:ss: A').diff(moment().startOf('day'), 'seconds');
returns 43812
I was just trying to achieve the same thing. using https://momentjs.com/
This is how I got what I wanted (03:11:23 => 11483 seconds)
myVar = moment.duration(myVar).asSeconds()
For mm:ss to seconds
myVar = moment.duration(`00:${'02:00'}`).asSeconds()//mm:ss to seconds