Monday, May 27, 2013

Javascript: Converting .NET DateTime to Javascript Date Object

User this:

var jsonDate = jqueryCall();  // returns "/Date(1245398693390)/"; 
var re = /-?\d+/; 
var m = re.exec(jsonDate); 
var d = new Date(parseInt(m[0]));

Resource:
http://stackoverflow.com/questions/1016847/converting-net-datetime-to-json

No comments: