compare date new Date javascript timestamp code example
Example 1: compare date javascript
// solution is convert date to time by getTime()
start = startDate.getTime();
end = endDate.getTime();
current = date.getTime();
if (start <= current && current <= end) {
// do something here
}
Example 2: compare date and time in js
var isLarger = new Date("2-11-2012 13:40:00") > new Date("01-11-2012 10:40:00");