当前位置:文秘家园>> 文字工作>> 实务性工作>> 电脑网络

电脑网络

网站时间的秒钟跳动代码

    】【收藏】  作者: 佚名  来源: 互联网络  阅读 次 【加入会员

    直接放到需要显示的网页地方即可。

 

<span class="bj_time">北京时间:<span id="ServerTime"></span></span>

<script type="text/javascript" src="http://php.weather.sina.com.cn/js/ServerTime.js"></script>

<script type="text/javascript">

<!--//--><![CDATA[//><!--

function test1(){

 ServerTime.$("ServerTime").innerHTML = ServerTime.year + "年" + ServerTime.monthTwoBit + "月" + ServerTime.dateTwoBit + "日 " + ServerTime.hoursTwoBit + ":" + ServerTime.minutesTwoBit + ":" + ServerTime.secondsTwoBit;

}

setInterval("test1()",100);

//--><!]]>

</script>

<script>

document.getElementById('time').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());

setInterval("document.getElementById('time').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);

</script>


手机扫码阅读本文


 

相关文章