﻿     tmpDate = new Date(); 
     date = tmpDate.getDate(); 
     month= tmpDate.getMonth() + 1 ; 
     year= tmpDate.getYear(); 
     if(navigator.appVersion.indexOf("MSIE")<0){year+=1900;}//FF3.0取出当前的年时是108，所以得加上1900才得2008年。不知道为什么会这样？ 
     document.write("当前时间 ");
     document.write(year); 
     document.write("年"); 
     document.write(month); 
     document.write("月"); 
     document.write(date); 
     document.write("日 ");         
     
     var c = "<font>" 
     var d = "</font>" 
         document.write('<span id="clock3"></span>'); 
    
     function showclock3() 
     { 
         var date3 = new Date(); 
         var hour3 = date3.getHours(); 
         var min3 = date3.getMinutes(); 
         var sec3 = date3.getSeconds(); 
         var col3 = ":"; 
         var x3; 
         x3=hour3; 
         //document.write(sec3); 
         if (x3>=24) x3=x3-24; 
         if (min3<=9) min3="0"+min3; 
         if (sec3<=9) sec3="0"+sec3; 
         document.getElementById("clock3").innerHTML =c+x3+col3+min3+col3+sec3+d; 
          
     } 
     setInterval("showclock3()",1000);
