125
rated 0 times
[
127]
[
2]
/ answers: 1 / hits: 24774
/ 13 Years ago, fri, may 27, 2011, 12:00:00
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.
More From » date