var date1 = new Date(); var date2 = new Date(); if (date1.getTime() === date2.getTime()) { // 1605815698393 === 1605815698393 console.log("Dates are equal"); } else { console.log("Dates are Not equal"); }