I try the following to get a timespan in milliseconds:
moment(0).minute(10).milliseconds()
The idea is to have a simple and readable way to convert timespans into milliseconds. But unfortunately this will always return 0, the initial time.
I think this is what you actually want to do:
moment.duration(10, "minutes").asMilliseconds();
I don't know if I got your question, but we can use JavaScript for timestamps
var start = new Date().getTime();
var elapsed = new Date().getTime() - start;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With