Reputation: 336
I need to convert this string format to millisecond.
I tried to user Moment to get millisecond
moment('2019-03-15 09:25:00','YYYY-MM-DD HH:mm:ss').milliseconds()
but it shows me 0 value.
All help is appreciated... Thanks in advance.
Upvotes: 0
Views: 494
Reputation: 5186
valueOf will used to get milliseconds.
m = moment('2019-03-15 09:25:00', 'YYYY-MM-DD HH:mm:ss');
console.log(m.valueOf());
Upvotes: 1