Posts Tagged ‘Convert DateTime Date Json’

My var in DateTime (C#) to Date (javasctipt):

var dotNetDate = "/Date(1373555464883)/";
var javaScriptDate = new Date(parseInt(dotNetDate.substr(6)));
console.log(javaScriptDate);
console.log(javaScriptDate.toLocaleFormat());
Output:
Date {Thu Jul 11 2013 12:11:04 GMT-0300}
quinta-feira, 11 de julho de 2013 12:11:04 

Enjoy it!