Showing posts with label javascript date comparison. Show all posts
Showing posts with label javascript date comparison. Show all posts

Sunday, June 23, 2013

javascript date comparison

A simple way to compara two date objects is to use the getTime() as shown below.

var d1 = new Date(2013, 6, 1);
var d2 = new Date(2013, 10, 1);
 
if (d1.getTime() > d2.getTime())
true;
else
false ;

cheers
Samitha