Example page for Lwangaman's dynamic jquery clock plugin



Clock that uses default options

This div will be turned into a dynamic clock
CODE:
$("#clock1").clock();
$("#destroyclock1").click(function(){ $("#clock1").clock("destroy") });
    

Clock that uses included italian language

This div will be turned into a dynamic clock
CODE:
$("#clock2").clock({"langSet":"it"});
$("#destroyclock2").click(function(){ $("#clock2").clock("destroy") });
    

Clock that uses extended portuguese language

This div will be turned into a dynamic clock
CODE:
$.clock.locale = {"pt":{
  "weekdays":["Domingo","Segunda-feira", "Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira", "Sábado"],
  "months":["Janeiro","Fevereiro","Março","Abril", "Maio","Junho","Julho","Agosto","Setembro","October","Novembro", "Dezembro"]
  } }
$("#clock3").clock({"langSet":"pt"});
$("#destroyclock3").click(function(){ $("#clock3").clock("destroy") });
    

Clock in 24 hour format, without calendar

This div will be turned into a dynamic clock
CODE:
$("#clock4").clock({"format":"24","calendar":"false"});
$("#destroyclock4").click(function(){ $("#clock4").clock("destroy") });
    

Clock with custom timestamp (13 days, 3 hours and 14 seconds ahead)

This div will be turned into a dynamic clock
CODE:
customtimestamp = new Date().getTime() + 1123200000+10800000+14000;
$("#clock5").clock({"timestamp":customtimestamp});
$("#destroyclock5").click(function(){ $("#clock5").clock("destroy") });
    

The advantage of this clock plugin is that it can also handle a server timestamp! Unfortunately it is not possible to inactuate this on jsbin.

Here's how you could do it, though:
CODE:
<?php 
$timestamp = time();
echo "<input id='servertime' type='hidden' value='".$timestamp."' />";
?>
  
Then in your javascript:
CODE:
servertime = parseFloat( $("#servertime").val() ) * 1000;
$("#clockn").clock({"timestamp":servertime});