Comparing two dates - Javascript Date Operation

Javascript examples for Date Operation:Date Compare

Description

Comparing two dates

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){// ww  w  . j  a v a2s . c  o m
var date1 = new Date(2018, 3, 3)
var date2 = new Date(2018, 3, 3)
console.log(date1)
console.log(date2)
console.log(date1 == date2)
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials