Q:

Date format being sent by REST API is Invalid in IE 11

I am currently making a series of REST calls to a backend API and I have no control over the format of the date being sent back in the JSON.
The format that is being sent is this
Wed, 21 Nov 2018 03:00:00.000Z
IE11 considers this an invalid date.  I have been using moment.js to get the current date and time and comparing it to the date and time being sent in the API.  It is working perfectly everywhere except in IE.  I have been trying everything I can from the Moment docs but everything that I return is considered invalid by IE11.  
I am setting my date as follows
var date = new Date("Wed, 21 Nov 2018 03:00:00.000Z");  

Update:  I have also tried setting the date using moment
var date = "Wed, 21 Nov 2018 03:00:00.000Z"
date = moment(d, "YYYY-MM-DD HH:mm:ss").toDate();

I have tried many different formats and everything returns invalid.
This is what returns as Invalid according to IE.  I have tried converting the date to a moment object first and then into a valid date format but that has not seemed to work either.
I was able to conclude that IE does not like the .000Z at the end of the date.  It works if I cut that off but that all my times are in GMT.

A:

The format YYYY-MM-DD HH:mm:ss you're putting in your momentJS constructor bears no resemblance to the date string you're actually inputting...you're telling moment to expect something like "2018-11-16 17:10:02". Maybe you've confused this with the format you want to output later, I'm not sure, because it clearly doesn't even come close to matching the example data.
Check http://momentjs.com/docs/#/parsing/string-format/ and choose the appropriate tokens to match the date format you're providing. Here's an example which will work for the date given in the example:

var d = "Wed, 21 Nov 2018 03:00:00.000Z";
var m = moment(d, "ddd, DD MMM YYYY HH:mm:ss.SZ"); //parse the date based on the format tokens given
console.log(m.format("YYYY-MM-DD HH:mm:ss")); //output the date in a different format
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>

