Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Compare two dates in javascript

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");
}
Source by stacksjar.com #
 
PREVIOUS NEXT
Tagged: #Compare #dates #javascript
ADD COMMENT
Topic
Name
4+2 =