网络编程
位置:首页>> 网络编程>> Asp编程>> asp如何制作一个倒计时的程序?

asp如何制作一个倒计时的程序?

  发布时间:2010-06-29 21:25:00 

标签:倒计时,asp

如何制作一个倒计时的程序?

    见下:

<%
CountdownDate = #1/1/2008 00:00:00AM#
If Date >= CountdownDate Then
    Response.Write "2008  北京"
    Response.End
End If
theDate    = Now
DaysLeft    = DateDiff("d",theDate,CountdownDate) - 1
theDate    = DateAdd("d",DaysLeft,theDate)
HoursLeft  = DateDiff("h",theDate,CountdownDate) - 1
theDate    = DateAdd("h",HoursLeft,theDate)
MinutesLeft = DateDiff("n",theDate,CountdownDate) - 1
theDate    = DateAdd("n",MinutesLeft,theDate)
SecondsLeft = DateDiff("s",theDate,CountdownDate) - 1
%>
<HTML>
<BODY>
现在时间: <%= Now %>
<p>
距离2008年还有 <%= DaysLeft%>天<%= HoursLeft %> 小时<%= MinutesLeft %>分 <%= SecondsLeft %>秒
</BODY>
</HTML>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com