09 January 2012

JSON - Parse a JSON date to a JS date

When a date is returned via JSON, it's written like this:
/Date(1326063600000)/
To convert this to a JavaScript Date, you parse it as follows:
new Date(parseInt(json.substr(6)))