﻿
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i]  }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=#000000; style='color:#0097CC; margin-right:10px; font-size:12px;font-family: 宋体'> ",
today.getFullYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日",
"</font>" ); 

                     
 
var a= "<font color='#0097CC' style='font-family: 宋体; margin-right:5px;'>北京时间 "
var b = "</font>" 
var c= "<font color='#0097CC' style='font-family: 宋体; margin-right:5px;'>伦敦时间 " 
var d = "</font>" 
var p= "<font color='#0097CC' style='font-family: 宋体; margin-right:5px;'>纽约时间 " 
var f = "</font>" 
var g= "<font color='#0097CC' style='font-family: 宋体; margin-right:5px;'>东京时间 " 
var h = "</font>" 
document.write('<span id="clock1"></span>');
function showclock() 
{
var date1 = new Date();
var hour1 = date1.getHours();
var min1 = date1.getMinutes();
var sec1= date1.getSeconds();
var col1 = ":";
var x1,x2,x3,x4,y,z;
x1=hour1;
x2=hour1-7;
x3=hour1+12;
x4=hour1+1;
if (x1 >=24) x1=x1-24; 
if (x2 >=24) x2=x2-24; 
if (x3 >=24) x3=x3-24; 
if (x4 >=24) x4=x4-24; 
if (min1<=9) min1="0"+min1; 
if (sec1<=9) sec1="0"+sec1;
clock1.innerHTML = a+x1+col1+min1+col1+sec1+b+'&nbsp&nbsp'+c
+x2+col1+min1+col1+sec1+d+'&nbsp&nbsp'+p
+x3+col1+min1+col1+sec1+f+'&nbsp&nbsp'+g
+x4+col1+min1+col1+sec1+h;
}
setInterval("showclock()",1000);

