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?
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?
This is actually supported via javascript. Have a look at the code below.
var dateString = "2019-03-04T06:20:30.000";
var dateObject = new Date(dateString);
alert(dateObject);
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'));