Minifycode 2021-10-03 Viewed 1K times Javascript

In this article, you will learn how to compare two dates in JavaScript

 

var date = new Date();
console.log(date.getTime());

setTimeout(()=>{
    var date1 = new Date();
    console.log(date1.getTime());
},500);

How to compare two dates in JavaScript
minify code