Javascript Countdown Clock

Real-time countdown to a specific date, with milliseconds. If the date is in the past it shows the time that has passed since then.

About This Script

Add this countdown to your site by copying and pasting the code wherever you want it to appear. Enter the date you want to countdown to in the box above.

Demo

Until

Code

<p id="countdown"></p> <p><span id="until">Until</span> <span id="toDate"></span></p> <noscript>Countdown provided by <a href="http://www.top-site-list.com">Top Site List Planet</a></noscript> <script> (function(){ var target = 1545739200000; var since = false; function pad(num, size) { var s = '000000000' + num; return s.substr(s.length - size); } function millisecondsToTime(ms) { milli = ms % 1000; var x = ms / 1000; seconds = Math.floor(x % 60); x /= 60; minutes = Math.floor(x % 60); x /= 60; hours = Math.floor(x % 24); x /= 24; days = Math.floor(x); string = days + ':' + pad(hours, 2) + ':' + pad(minutes, 2) + ':' + pad(seconds, 2) + ':' + pad(milli, 3); return string; } function update() { var d = new Date(); now = d.getTime(); diff = target - now; if (diff < 0) { diff = now - target; if (!since) { setSince(); } } document.getElementById('countdown').innerHTML = millisecondsToTime(diff); } function setSince() { document.getElementById('until').innerHTML = 'Since'; since = true; } function startCountdown() { var toDate = new Date(target); document.getElementById('toDate').innerHTML = toDate.toUTCString(); setInterval(update, 10); } // Run! startCountdown(); })(); </script>
More scripts

Do you want to expose your site to millions?
Do you want to be ranked higher in Google?
Do you want to be known as the best site in your niche?

Then look no further. Add your site in 3 simple steps. Sign up, Add your site and Start receiving votes! It only takes 10 seconds!

Sign Up to Top Site List Planet Now!

Login with one of these social networks...

Sign in with FacebookSign in with TwitterSign in with Google+Sign in with Yahoo!Sign in with LinkedIn

or create an account with your email...

Login To An Existing Account