<!doctype html> <html> <head> <meta charset="utf-8"> <title>时钟</title> </head> <body> </body> </html> <script type="text/javascript"> var a=1456972495000; setInterval(function(){ a=a+1000; var newDate = new Date(); newDate.setTime(a); h=newDate.getHours(); // 获取当小时 m=newDate.getMinutes(); s=newDate.getSeconds(); console.log(h+":"+m+":"+s); // seckill.gotabNum(h); },1000) </script>