首页 > 互联资讯 > 技术交流  > 

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

<%
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
%>



现在时间: <%= Now %>


距离2008年还有 <%= DaysLeft%><%= HoursLeft %> 小时<%= MinutesLeft %> <%= SecondsLeft %>.走得最急的,都是最美的时光.

[1]

如何制作一个倒计时的程序?由讯客互联技术交流栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“如何制作一个倒计时的程序?