Countdown to Date ASP Script - ASP Web Pro
  Active Server Pages Programming by ASP Web Pro

ASP Scripts

COUNTDOWN TO DATE

Another trick you can do with dates is to display a countdown to a certain date. Let's say you wanted to display a countdown to New Years Day in the year 2100. Here is how to do it:

<%
DIM strDate
strDate = Date()

Response.Write DateDiff("d", strDate, #1/1/2100#) & " : "
Response.Write DateDiff("m", strDate, #1/1/2100#) & " : "
Response.Write DateDiff("yyyy", strDate, #1/1/2100#)
%>

This displays the countdown in days, months, and years between today and 1/1/2100 and today like this:
33474 : 1100 : 92

< Back to ASP Scripts


 

 

Main Menu
Home
ASP Scripts
ASP Tutorials
JavaScripts
Awards
Contact Us

Email This Page

Other Resources
ASP Web Hosting
Search Engine Submission
Programming Help

 

 

 

Other ASP Web Sites

Site Map

 

Last Updated:
09 May 2008