I have variable which I populate from JSON formated data.
Something like:
var time=my_data[data.results[i].id].time;
This gives me time from database in this format : 2012-06-19 15:48:18.140
How can save in some other variable value for example active if the time between a value that I get from database and time which is present(now) is less then 5 min and inactive if it is more then 5 min passed
Thank you
See the DOC for javascript Date
Date Constructor accepts a date string. I tried yours in chrome console it works fine.
Then you can use getTime to get number of milliseconds since January 1, 1970
Finally