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:
1279 Months
38933 days
934397 hours
56063827 Minutes
3363829673 seconds
Read more on the DateDiff function
Get the best asp hosting provider from web-hosting-top.com and save up to 30%
Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.
