var myDate = isoStringReturnedFromRESTCall;
var displayDate = new Date(myDate);
Then either pull out what I needed from displayDate, or format it appropriately when creating the Date object. All is good there, except I needed to support IE8. Turns out IE8 doesn’t support creating Date objects from an ISO date format, it throws an “Invalid Date” error. Crap.
To get around this, I ended up creating the date object from Date.UTC after splitting out the appropriate components from the ISO date string. Here’s what that looks like:
var updateDateStr = isoStringReturnedFromRESTCall;
var updateDateArray = updateDateStr.split(‘T’);
var dateArray = updateDateArray.split(‘-‘);
var timeArray = updateDateArray.split(‘:’);
var updateDate = new Date(Date.UTC(dateArray, dateArray-1, dateArray, timeArray, timeArray, 00));
From there I could interact with updateDate as a normal Date object.