兼容IE,FF浏览器,世界各地区域的JS时间计算

<table height=”25″ cellspacing=”0″ cellpadding=”0″ border=”0″>
<tbody>
<tr valign=”top”>
<td valign=”center”>北京时间[<span id="beijing">10:24:10</span>]</td>
<td valign=”center”>伦敦时间[<span id="london">02:24:10</span>]</td>
<td valign=”center”>纽约时间[<span id="newyork">21:24:10</span>]</td>
<td valign=”center”>芝加哥时间[<span id="chicago">20:24:10</span>]</td>
<td valign=”center”>东京时间[<span id="tokyo">11:24:10</span>]</td>
</tr>
</tbody>
</table>
//<![CDATA[
function time_rota()
{
var now;
var h,m,s;
now = new Date();
h=now.getHours();
m=now.getMinutes();
s=now.getSeconds();
h=((h < 10) ? "0" : "") + h;
m=((m < 10) ? "0" : "") + m;
s=((s < 10) ? "0" : "") + s;
document.getElementById('beijing').innerHTML = h + ":" + m + ":" + s;
setTimeout("time_rota()", 1000);
}
time_rota();
function time_rota1()
{
var now;
var h,m,s;
now = new Date();
h=now.getUTCHours();
h -= -0;
if(h<0)
{h += 24;}
m=now.getUTCMinutes();
s=now.getUTCSeconds();
h=((h < 10) ? "0" : "") + h;
m=((m < 10) ? "0" : "") + m;
s=((s < 10) ? "0" : "") + s;
document.getElementById('london').innerHTML = h + ":" + m + ":" + s;
setTimeout("time_rota1()", 1000);
}
time_rota1();
function time_rota2()
{
var now;
var h,m,s;
now = new Date();
h=now.getHours();
h -= 13;
if(h<0)
{h += 24;}
m=now.getMinutes();
s=now.getSeconds();
h=((h < 10) ? "0" : "") + h;
m=((m < 10) ? "0" : "") + m;
s=((s < 10) ? "0" : "") + s;
document.getElementById('newyork').innerHTML = h + ":" + m + ":" + s;
setTimeout("time_rota2()", 1000);
}
time_rota2();
function time_rota3()
{
var now;
var h,m,s;
now = new Date();
h=now.getUTCHours();
h -= -9;
if(h<=0)
{h += 24;}
m=now.getUTCMinutes();
s=now.getUTCSeconds();
h=((h < 10) ? "0" : "") + h;
m=((m < 10) ? "0" : "") + m;
s=((s < 10) ? "0" : "") + s;
document.getElementById('tokyo').innerHTML = h + ":" + m + ":" + s;
setTimeout("time_rota3()", 1000);
}
time_rota3();
function time_rota4()
{
var now;
var h,m,s;
now = new Date();
h=now.getUTCHours();
h -= 6;
if(h<=0)
{h += 24;}
m=now.getUTCMinutes();
s=now.getUTCSeconds();
h=((h < 10) ? "0" : "") + h;
m=((m < 10) ? "0" : "") + m;
s=((s < 10) ? "0" : "") + s;
document.getElementById('chicago').innerHTML = h + ":" + m + ":" + s;
setTimeout("time_rota4()", 1000);
}
time_rota4();
//]]>