您的位置:首页 > 编程语言

世界各国时间代码,留着备用!

2013-07-16 14:08 225 查看
世界各国时间代码,留着备用!代码如下:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />

<title>世界时间代码</title>

<style type=”text/css”>

*{margin:0px;padding:0px; font-size:12px;}

</style>

</head>

<body>

<div style=”width:1000px;line-height:30px;margin:0 auto; background:#ccc;”>

<TABLE height=15 cellSpacing=0 cellPadding=0 width=”96%” border=0>

<TR vAlign=top>

<TD vAlign=center nowrap class=”font1″>北京时间[<SPAN id=beijing></SPAN>]</TD>

<TD vAlign=center nowrap class=”font1″>伦敦时间[<SPAN id=london></SPAN>]</TD>

<TD vAlign=center nowrap class=”font1″>纽约时间[<SPAN id=newyork></SPAN>]</TD>

<TD vAlign=center nowrap class=”font1″>芝加哥时间[<SPAN id=chicago></SPAN>]</TD>

<TD vAlign=center nowrap class=”font1″>东京时间[<SPAN id=tokyo></SPAN>]</TD>

</TR>

</TABLE>

<SCRIPT language=javascript type=text/javascript>

//<![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.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>

</div>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: