JavaScript compare dates

Compare two dates in JavaScript.

var now = new Date();
var past = new Date('2020-01-01');
console.log(past.getTime() < now.getTime());
true
View this page on GitHub.
Posted .

Comments

Leave a Reply