页面动态显示当前时间

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<style type="text/css">
<!--
*{margin:0; padding:0;font-size: 12px;}
body
{	
	background-repeat: repeat-y;
	background-position: left top;	
}
#footer{
clear:both;
width:100%;
padding:1px 0;
margin:0 0px;
background-color:steelblue;
}

#footer p{padding:0; margin:0; text-align:center;}
#footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;}
#footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;}

-->
</style>
</head> 
<body>
<div id="footer">
<p>
<table width="100%" border="0" height="20" cellpadding="0" cellspacing="0" >
  <tr>
	<td width="10">&nbsp;</td>
	<td width="200" align="center"><nobr><span id="timetest" style="COLOR:white"></span>
		    <!--动态日期的js代码 -->
			<script>
              dt=new Date();
              var tmpstr="";
              var month = dt.getMonth();
              var date = dt.getDate();
              if ((month == 0) && (date == 1)) tmpstr= "元旦";
              if ((month == 4) && (date == 1)) tmpstr = "国际劳动节";
              if ((month == 4) && (date == 4)) tmpstr = "青年节";
              if ((month == 5) && (date == 1)) tmpstr = "国际儿童节";
              if ((month == 9) && (date == 1)) tmpstr = "国庆节";
              if ((month == 11) && (date == 25)) tmpstr = "圣诞节";
              tmpstr = " " + "<font color='#BB0000'>" + tmpstr + "&nbsp;&nbsp;</font>"
              setInterval("timetest.innerHTML=new Date().toLocaleString()+' 星期'+'日一二 
                三四五六'.charAt (new Date().getDay())+tmpstr;",1000);
           </script>
		</nobr>
	</td>					
   </tr>
  </table>
 </p>
</div>
</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值