Javascript examples for Date Operation:Day
compare the given date with today date using Javascript
<html> <head></head> <body> <p id="demo"></p> <p id="today"></p> <p id="text"></p> <script> today = new Date();/* w w w . j av a 2s. c om*/ jan19 = new Date('2018-01-19') document.getElementById("demo").innerHTML = jan19; document.getElementById("today").innerHTML = today; if (today < jan19) { document.getElementById("text").innerHTML = 'true'; } else { document.getElementById("text").innerHTML = 'false'; } </script> </body> </html>