If you really want to know if two Date objects represent exactly the same time or are before / after one another, it's pretty simple: just compare the two dates using a method getTime()that returns an integer timestamp for the object. For instance,
var date1 = myDate,
date2 = new Date();
return (date1.getTime() < date2.getTime());
will return true if myDate is up to "now", false if it is now or in the future.
source
share