Possible Duplicate:
Format Date in Javascript
I have this date:
var newDate = "/Date(1333609200000)/";
And what I need to do to it is:
var myDate = new Date(1333609200000);
I thought about just trimming off "/Date()/" and then getting just the number inside but I wasn’t sure if that would be best here. Should I just simply regex the number out of that? Is there a better approach?
Notes: The date is being created by c#’s JavascriptSerializer and comes in the format newDate above. It cannot be changed in c# due to constraints.
You could do it like this: