Question: > 
> **Possible Duplicate:**  
> 
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
> 
> 
> 

The ASP.NET function `Json()` formats and returns a date as

```
{"d":"\/Date(1240718400000)\/"}

```

which has to be dealt with on the client side which is problematic. What are your suggestions for approaches to sending date values back and forth?

Answer: 
This was found in [another post](https://stackoverflow.com/questions/206384/how-to-format-json-date) on Stack Overflow:

```
var date = new Date(parseInt(jsonDate.substr(6))); 

```

The substr function takes out the "/Date(" part, and the parseInt function gets the integer and ignores the ")/" at the end. The resulting number is passed into the Date constructor.
It may be ugly, but it works:

```
 var epoch = (new RegExp('/Date\\((-?[0-9]+)\\)/')).exec(d);
 $("#field").text((new Date(parseInt(epoch[1]))).toDateString());

```

Probably, it is not necessary to match the whole string, and just (-?[0-9]+) is enough...