ASP Countdown Script

Using the DateDiff VBScript function we can create a countdown to a particular date. Our code below uses the date 2010 to tell us the number of months, days, hours, minutes and seconds to go.

<%
Response.write DateDiff("m","2010",Now()) & " Months<br>"
Response.write DateDiff("d","2010",Now()) & " days<br>"
Response.write DateDiff("h","2010",Now()) & " hours<br>"
Response.write DateDiff("n","2010",Now()) & " Minutes<br>"
Response.write DateDiff("s","2010",Now()) & " seconds<br>"
%>

Here's our script in action:
1262 Months
38418 days
922050 hours
55323017 Minutes
3319381043 seconds

Read more on the DateDiff function

Get the best asp web hosting provider now and save 30%

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Free ASP Hosting