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

Javascript examples for jQuery Method and Property:jQuery Method Example


Javascript clock with server time PHP

Demo Code

ResultView the demo in separate window

  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src=""></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);

  <label id="timer"></label>  

Related Tutorials