Some more beesty javascript, this time a timer that counts down to the day everybody’s waiting for: January 20, 2009. Don’t have anywhere to put it at this point, but it’s kind of cool. It can also easily be modified to count down to whatever else you’re looking forward to. See it in action here.
function countdown() {
var today=new Date();
var target=new Date(2009, 0, 20, 00, 00, 1);
var time_left=(target - today);
var year=Math.floor(time_left/(1000*60*60*24*365));
time_left%=(1000*60*60*24*365)
var day=Math.floor(time_left/(1000*60*60*24));
time_left%=(1000*60*60*24);
var hour=Math.floor(time_left/(1000*60*60));
time_left%=(1000*60*60);
var minute=Math.floor(time_left/(1000*60));
time_left%=(1000*60);
var sec=Math.floor(time_left/1000);
time_left%=1000
var half_sec=Math.floor(time_left/10);
if (half_sec <= 9)
half_sec="0" + half_sec
document.getElementById('clock').innerHTML=year + ' year, ' + day + ' days, ' + hour + ' hours, ' + minute + ' minutes, ' + sec + '.' + half_sec + ' seconds until Bush leaves office.';
t=setTimeout('countdown()',5);
}
window.onload=countdown;