Json Date standards have not yet come out, so there are various styles of date, and we often have a lot of natural problems using js.
About standards can see http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx
If you use Microsoft's Json serialization library, the date will look like this:
/Date (1224043200000 )/
The following is the method for converting to JS obj.
Var date = eval (jsonDate. replace (// Date \ (\ d +) \ // gi, "new Date ($1 )"));
// General Practice
Var date = new Date (parseInt (jsonDate. substr (6 )));
// More efficient and recommended
If you use JSon.net, the date will look like this:
/Date (1224043200000 + 0800 )/
The following is the method for converting to JS obj.
Replace (// Date \((.*?) \) \ // Gi, "new Date ($1 )");
Because there is an improvement in the middle, if you want a more efficient method, the same way as above :)