// JavaScript Document
var now = new Date();
var iHour     = now.getHours();
var iMinute   = now.getMinutes();
var iSecond   = now.getSeconds();
var sHour   = "";
var sMinute = "";
var sSecond = "";
function funClock() {
  iSecond  = iSecond + 1;
  //alert(sSecond);
  if (iSecond == 60){
    iSecond = 0;
    iMinute = iMinute +1;
    if(iMinute == 60){
      iMinute = 0;
      iHour = iHour +1;
      if(iHour == 24){
        iHour = 0;
      }
    }
  }
  sHour    = iHour;
  sMinute  = iMinute;
  sSecond  = iSecond;
  if (sHour < 10){
    sHour = "0" + sHour;
  }
  if (sMinute < 10 ){
    sMinute = "0" + sMinute;
  } 
  if (sSecond < 10){
    sSecond = "0" + sSecond;
  }
  movingtime = sHour + ":" + sMinute + ":" + sSecond;
  document.getElementById("clock").innerHTML = movingtime;
  setTimeout("funClock()", 1000);
}
<!--//
var tmpDate = new Date();
date = tmpDate.getDate();
month= tmpDate.getMonth() + 1 ;
year= tmpDate.getFullYear();
document.write(year);
document.write("-");
if (month < 10) document.write("0");
document.write(month);
document.write("-");
if (date < 10) document.write("0");
document.write(date);
// -->
document.write("&nbsp;&nbsp;<span id=clock></span>");
funClock();
