Javascript examples for Date Operation:Date Compare
Compare dates
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {// ww w .j ava2s. co m var startDate = new Date(), endDate, delta; setTimeout(function() { endDate = new Date(); delta = endDate.getTime() - startDate.getTime(); console.log(delta + ' ms'); }, 1000); }); </script> </head> <body> </body> </html>