I'm new to javascript but I want to parse this date.
2019-03-04T06:20:30.000
How can I do this?
Date.parse()or new Date() not works for this format.
Should I have to change this into string and use regular expression?
Try .toLocaleDateString()
console.log(new Date('2019-03-04T06:20:30.000').toLocaleDateString('en-GB'));
console.log(new Date('2019-03-04T06:20:30.000').toString('en-GB'));
toLocaleDateString() isn't parsing anything here. and OP has already stated that "new Date() not works for this format."
Date.parse()andnew Date()should both work. What are you expecting this date to be? As an ISO date this represents 4th march.