Count Down to an Event or Specific Date  

To count down by days to a certain date or event highlight the following script with your mouse. Then press Ctrl and C to copy it. Locate where you want the count down to show on your web page and press Ctrl V to paste it to your page.

The blue text is where you change the size of your countdown text
Replace the text that you see here in red with your own text.

  • The first is the date you are counting down to.
  • The next two are what you want it to read two days and one day until the event - be sure they will make sense!
  • The last one announces that the event has arrived
<script language="JavaScript">
<!--
document.write("<font face=arial size=2>")
var y2k = new Date("July 9, 2002");
var now = new Date();
var diff = y2k.getTime() - now.getTime();
var answer = Math.floor(diff / (1000 * 60 * 60 * 24));
if (answer > 1)
document.write(answer + " days left until my birthday")
else if (answer == 1)
document.write("Only two days left until my birthday")
else if (answer == 0)
document.write("Tomorrow is my birthday")
else
document.write("Today is my birthday!");
document.write("</font>")
//-->
</script>

Back to free tools page


© 1997-2005 Digital-Presence All Rights Reserved