How to convert a C# DateTime object to a JavaScript Date object

When you are working with JSON and C# with DateTime objects, the serialized string of it looks like this:/Date(1425408717000)/In order to turn this into a usable JavaScript Date object you will need to strip out the non-numerical characters:var cSharpDate = /Date(1425408717000)/ var stripedCsharpDate = cSharpDate.replace(/[^0-9…