Possible Duplicate:
How do I get the difference between two Dates in JavaScript?
I wanted to know how javascript can count the years and months between two dates. So for example between 26/10/2012 and 26/11/2013, there are 1 year and 1 month
I have tried it so but it is wrong :(
var diff = (new Date(y, m - 1, d).getTime(2011,(11-1),26) - new Date(2012, (11-1), 26).getTime()) / 1000 / 60 / 60 / 24 / 30;