Q:

JavaScript Date receive as object like this trip.Date: "/Date(1426530600000)/"

My javascript Date received like this.
trip.Date: "/Date(1426530600000)/"
How can i convert this to Date format
I tried this working:
var dt = new Date(1426530600000); // output: Tue Mar 17 2015 00:00:00 GMT+0530 (India Standard Time)
Is there any other predefined methods to convert this  "/Date(1426530600000)/"

A:

Use for example an RegEx expression such as this, then:

var regExp = /\(([^)]+)\)/;
var matches = regExp.exec("/Date(1426530600000)/");  // insert string
alert(new Date(parseInt(matches[1], 10)));           // parseInt() the string

A string split is a good alternative.

