on the aspx I am getting
date = /Date(1420460565000)/
I tried to parse it javascript date bject
var dateformatted = new Date(date);
However when I run it I am getting Invalid Data
How do I parse the c# DateTime
object?
on the aspx I am getting
date = /Date(1420460565000)/
I tried to parse it javascript date bject
var dateformatted = new Date(date);
However when I run it I am getting Invalid Data
How do I parse the c# DateTime
object?
You could try this one:
var dateformatted = new Date(parseInt(date.substr(6)));
This works because substr
function takes out the "/Date(" part, and the parseInt function gets the integer and ignores the ")/" at the end. The resulting number is passed into the Date constructor. Hence a new Date can be created.