I'm trying to use the new Date() object in FireFox. I'm pulling the date using this code:
var createDate = document.querySelector('.formatted-absolute-date').innerText;
Which returns the following:
var createDate = document.querySelector('.formatted-absolute-date').innerText;
createDate
"2021-08-19 08:20:53 AM"
But when I try and create a new Date object using the following code, I get an Invalid Date error.
var newDate = new Date(createDate);
newDate
Invalid Date
How can I make createDate
be a valid Date?