<%
response.write "距国庆节还有"
response.write "<font color=blue><u>"
response.write DateDiff("d",Date(),"2007-09-27")
response.write "</font></u>"
response.write "天"
%>
一个动态的北京倒计时JS程序:(摘自TX网站)
<script>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerText = dnum+"天";
document.getElementById("times").innerText = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
</script>
<table width="170" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="24" colspan="2" style="Font-size:12px;padding-top:5px">距08年8月8日 奥运会开幕还有</td>
</tr>
<tr>
<td align="center" class="fb" id="timeDate" style="Font-size:14px;Font-weight:bold"></td>
<td align="center" class="fb" id="times" style="Font-size:14px;Font-weight:bold"></td>
</tr>
</table>