Javascript clock with server time PHP - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery Method Example

Description

Javascript clock with server time PHP

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//w  w  w .jav a  2 s  . c  om
var d = new Date(Date.UTC(2018,12,12,17,11,36));
setInterval(function() {
        d.setSeconds(d.getSeconds() + 1);
        $('#timer').text((d.getHours() +':' + d.getMinutes() + ':' + d.getSeconds() ));
    }, 1000);
    });

      </script> 
 </head> 
 <body> 
  <label id="timer"></label>  
 </body>
</html>

Related Tutorials