I am looking to utilize Moment.js for time management purposes.
My goal is to convert a string into a moment object and then convert it to milliseconds.
This is how I am currently attempting to achieve this:
const str = "1:12.123"; // 1m, 12s, 123ms = 72123ms
const parsed = moment(str, "m:ss.SSS");
The issue I am encountering is that the moment created by this method is based on "today" rather than epoch time.
console.log(parsed); // moment("2018-10-27T00:01:12.123")
console.log(parsed.unix()); // 1540609272, not 72123
Is there a way to parse a string based on epoch time instead of using today's date? Alternatively, do I need to manually convert the string to a number and calculate milliseconds myself?