Relatively simple javascript here, not sure why IE hates me (treat others how you want to be treated I suppose).
var newDate = new Date(\"2012, 11, 2 19:30:0
I was having the same issue with Internet Explorer. This is how I was formatting the date and time initially,
function formatDateTime(date, formatString = 'MM/DD/YYYY hh:mm A') {
return moment(new Date(date)).format(formatString);
}
The problem was with new Date()
. I just removed it as it was already a UTC
date. So it is just,
return moment(date).format(formatString);
This worked for me in all browsers including IE.