You can convert this date to a format that javascript likes. Just delete the “T” and everything after the “+”:
var val = '2009-09-02T07:35:00+00:00', date = new Date(val.replace('T', ' ').split('+')[0]);
Update: If you need to compensate for the time zone offset, you can do this:
var val = '2009-09-02T07:35:00-06:00', matchOffset = /([+-])(\d\d):(\d\d)$/, offset = matchOffset.exec(val), date = new Date(val.replace('T', ' ').replace(matchOffset, '')); offset = (offset[1] == '+' ? -1 : 1) * (offset[2] * 60 + Number(offset[3])); date.setMinutes(date.getMinutes() + offset - date.getTimezoneOffset());
Prestaul Sep 13 '09 at 3:15 2009-09-13 03:15
source share