Today, I was working with the C# DateTime datatype and Jquery, where I wanted to return DateTime as Json. I ended up getting dates in the format like
After my little search on the internet, I found out that the value returned were actually date time value in milliseconds along with some special characters like ‘/’,’()’ and ‘Date’.
The solutions are many, I will just point out one of the easiest and efficient method which I chose to use in my application.
var milliseconds = "/Date(1245398693390)/".replace(//Date((-?d+))//, '$1');
var actualDate = new Date(parseInt(milliseconds ));
Hope this helps 🙂