I am using jquery ajax($.ajax) method to get a json object from c# webmethod.This json object contains a datetime value, which looks something like this ‘/Date(1329324492302)/’ and I tried to parse it using the following js
new Date(parseInt(json.d.Date.replace("/Date(", "").replace(")/",""), 10))
and the resulting date looks something like this
Date {Wed Feb 15 2012 16:48:12 GMT+0000 (GMT Standard Time)}
I want to find the time elapsed from this datetime to current time in javascript but I am not sure how to do it,as the parsed date looks like a string instead of a date.
Could someone please help.
Thanks
1 Answer