dragonfly dragonfly - 18 days ago 10
ASP.NET (C#) Question

How to convert JavascriptSerializer serialized DateTime string to Javascript Date object

After serializing an object with

DateTime
field with
JavaScriptSerializer
, I see that the
DateTime
field looks like this:

EffectiveFrom: "/Date(1355496152000)/"


How can I convert this string to Javascript Date object?

Answer

There is an answer that may help you:

Parsing Date-and-Times from JavaScript to C#

If you want to parse datetime string to datetime value with javascript you must use "new Date" like this:

var data = new Date("1355496152000");
Comments