Industry guru Dave Taylor offers free tech support on a wide variety of technical and business topics, including HTML, online advertising, Cascading Style Sheets, Web design, management, Unix, Linux, search engine optimization, online dating, Mac OS X, shell script programming and Microsoft Windows.

How do I add a countdown timer to my Web site?

Hi there, I noticed, on a previous entry, somebody asked how to add a countdown timer to their website, well I am also interested in one for my website, on how long until the next clan match is for Socom II, am i able to get a visual countdown timer, where when people go on the website, they can watch it count down, also, could it say days, hours minutes, etc, and also maybe colourful.


Dave's Answer:

I'll answer with a bunch of links, this time, rather than reinvent the wheel with my own solution. Here's a list of some of the most interesting or clearly-written countdown timers in a variety of different languages.

Remember, though, that anything written in JavaScript has the inherent problem that it's relying on the clock of the visitor's computer being accurate. Macs all seem to sync to the network time servers, but I often see Windows machines off by hours, day, and sometimes even weeks (even in an otherwise well-managed IT environment like the University of Colorado, Boulder). However, if you're happy with a "95% solution", JavaScript will work fine...

There are also plenty more listed on Google. Simply search for countdown javascript.

Any of the above should get you going without much fuss or hassle. Remember that it's always preferable to copy and paste code rather than link to another server, because you never know what might happen to the remote site.

Thanks to Kim Smith, Matthew Edgar, John Carson, Chris Buechler and John Marshall for their suggestions.


Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon    

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

My friend made a counter for me the other day and posted it on his new site.

http://javascriptjedi.com/countdown

It's cool because you can css it, and it will remove itself from the document the moment that it expires.

Check it out.

JavascriptJedi is still a new work in progress, but the guy is pretty good at what he does.

Posted by: Chris at April 12, 2005 10:53 PM

Hmmm...seems to still flicker in Firefox. I've tried all sorts of fixes and can't seem to get any countdown to not flicker in Firefox (unless I use an INPUT field to display the countdown).

Does anyone have a fix for the Firefox flicker?

Posted by: Terry Apodaca at August 18, 2005 7:46 PM

Dear Dave,

I would really appreciate if you can get back to me on this.

I am developing a quiz game for my students with FrontPage2003, basically each page is a set of multiple choice questions, with one correct choice out of five. I need a countdown timer to start once each page is loaded and this is where I need your help.

I am looking for help in including a countdown timer on the pages that would (1.) start timing each page once loaded and (2.) display a page that shows the student has not answered the question correctly, in order words, if the page fails validation by the student not answering in the specified time, a page is displayed saying so.

So in effect, this validation failure page is displayed when,
(1.) the student fails to answer correctly (this is pretty straight forward - a form validation failure page can be displayed when a wrong answer is chosen).

(2.)I need this same form validation failure page displayed if a student fails to answer in the specified time.

The form would therefore be invalidated by a wrong answer and failure to answer in specified time, it is in the latter I need your help.

I'd really appreciate your prompt response, time is of the essence for me here. Thanks for your time


Regards,

Posted by: Koffi at October 22, 2008 2:49 AM

I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Uniblue: Free Virus Scan

Search
Find just the answers you seek from among our 2000+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2009 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.