Compare two dates in javascript

by satheeshkumar 2012-09-26 12:54:28

Compare two dates in javascript ,

var firstDate=new Date();
firstDate.setFullYear(start[0],(start[1] - 1 ),start[2]);
var secondDate=new Date();
secondDate.setFullYear(end[0],(end[1] - 1 ),end[2]);
if(firstDate > secondDate)
{
alert("first date is greater");
}
else
{
alert("second date is greater");
}

690
like
1
dislike
0
mail
flag

You must LOGIN to add comments