Possible Duplicate:
Get difference between 2 dates in javascript?
I am storing date variables like this:
var startYear = 2011;
var startMonth = 2;
var startDay = 14;
Now I want to check if current day (today) is falling within 30 days of the start date or not. Can I do this?
var todayDate = new Date();
var startDate = new Date(startYear, startMonth, startDay+1);
var difference = todayDate - startDate;
????
I am not sure if this is syntactically or logically correct.