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:
1260 Months
38380 days
921133 hours
55267991 Minutes
3316079470 seconds
Read more on the DateDiff function
Get the best asp web hosting provider now and save 30%
Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.