Skip to content

Instantly share code, notes, and snippets.

@sekimura
Created March 10, 2009 18:12
Show Gist options
  • Save sekimura/77040 to your computer and use it in GitHub Desktop.
Save sekimura/77040 to your computer and use it in GitHub Desktop.
var currHhmm;
function refreshClock() {
var d = new Date;
var hh = d.getHours();
var mm = d.getMinutes();
if (hh < 10) hh = "0" + hh;
if (mm < 10) mm = "0" + mm;
var hhmm = [hh, mm].join('');
if ( currHhmm !== hhmm) {
currHhmm = hhmm;
var src = "http://bijint.com/m/img/photo/" + hhmm + ".jpg";
document.getElementById('clock').innerHTML = '<img width="345" height="460" src="' + src + '"/>';
}
setTimeout(refreshClock, 1000 * 5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment