JavaScript时区显示
时间:2008-11-26 12:04:03浏览:16362
北京时间 <SPAN id=beijing></SPAN>
伦敦时间 <SPAN id=london></SPAN>
纽约时间 <SPAN id=newyork></SPAN>
芝加哥时间<SPAN id=chicago></SPAN>
东京时间 <SPAN id=tokyo></SPAN>
<SCRIPT language=javascript type=text/javascript>
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.all.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.all.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.all.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.all.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.all.chicago.innerHTML = h+\":\"+m+\":\"+s;
setTimeout(\"time_rota4()\", 1000);
}
time_rota4();
</SCRIPT>
1上一篇:退弹代码
下一篇:历史的记录,终于在自己家可以装宽带了
- Linux文章
- PHP文章
- 随机文章
- Linux中的find(-atime...
- mysql的expire_logs_...
- PHP 扩展 libsodium s...
- Linux下利用find和cp实现筛...
- 使用mysqldump命令导出备份m...
- Linux系统如何设置开机自动运行脚...
- Linux上实现秒级执行的定时任务
- shell echo -e 颜色输出
- Linux下通过grep查找指定的进...
- 解决执行脚本报syntax erro...
发表评论
昵称: 验证码:
gBqsPxAZ 于 2024-10-08 12:19:33 发表评论:
e