C# .net DateTime to JavaScript Date

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!

One thought on “C# .net DateTime to JavaScript Date

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s