I have a JSON date coming back as \/Date(1390982400000)\/
which I use the below code to turn into a date, but I'm not sure how to format it as "mm-dd-yyyy"
. Right now the date shows as "Wed Jan 29 2014 00:00:00 GMT-0800
(Pacific Standard Time)" but I want it "mm-dd-yyyy"
.
I'm sure it's simple, but I can't get anything to work...
Code:
var startDate = new Date(parseInt(result.d[0].StartDate.substr(6))); // formats the date
$("#startDate").val(startDate);