Unfortunately, your "from" dateformat is not implementation independent in JavaScript. And all other formats are implementation-dependent, which means that even if this format will be understood by most of the implementation, I / you cannot be sure, for example, how the order of DD and MM will be handled (I'm almost sure that this will depend on local regional settings). Therefore, I would recommend using a third-party parser (or your hand) to get the Date object from your input string. You can find one such parser here: http://www.mattkruse.com/javascript/date/
Since your question is not 100% clear to me, it is possible that you have a date in the format / Date (number) /, which assumes that you are calling the ASP.Net service from your jQuery code. In this case, during JSON parsing, you can convert it to a Date object:
data = JSON.parse(data, function (key, value) { // parsing MS serialized DateTime strings if (key == '[NAME_OF_DATE_PROPERTY_IN_THE_JSON_STRING]') { return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10)); // maybe new Date(parseInt(value.substr(6))) also works and it simpler } return value; });
source share