Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page




 

Date count down

Example

Source code

Change the date that is bold to your own special date to get your own customized date countdown.

<SCRIPT LANGUAGE="JAVASCRIPT"><!-- hide this script tag's contents from old browsers

today = new Date();

BigDay = new Date("December 25, 2010")
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("There are only<BR> <H4>" + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes left </H4> Until December 25th 2010 (Christmas)<P>");

// -- done hiding from old browsers --></SCRIPT>

Index

Category:
Cool Tricks

Companies:
None

Related Pages:
HTML Help

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope