Javascript examples for Date Operation:Date Format
compare 2 time in format (HH:MM:SS)
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from www . j av a 2s .c om var now = new Date(); var deadline = new Date(); deadline.setHours(16); deadline.setMinutes(0); if( now > deadline ) { console.log('after deadline'); } else { console.log('before deadline'); } } </script> </head> <body> </body> </html>