Search
Sponsors

Posts Tagged ‘clock’

Title bar clock

Thursday, September 24th, 2009
   1:  <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
   2:   
   3:  <HEAD>
   4:  <SCRIPT LANGUAGE="JavaScript">
   5:  <!-- Original: Massimo Giari (motore@iol.it) -->
   6:  <! >
   7:  <! >
   8:  <!-- Begin
   9:  var clocktext, timeday;
  10:  var pagetitle = document.title;
  11:  function scroll() {
  12:  today = new Date();
  13:  sec = today.getSeconds();
  14:  hr = today.getHours();
  15:  min = today.getMinutes();
  16:  // 12 Hour clock fix by Michael Mann (pres@manninc.com)
  17:  if (hr < 12) { timeday = " AM"; }
  18:  else { timeday = " PM"; }
  19:  if (hr > 12) hr = hr - 12;
  20:  if (hr <= 9) hr = "0" + hr;
  21:  if (min <= 9) min = "0" + min;
  22:  if (sec <= 9) sec = "0" + sec;
  23:  var clocktext = " - " + hr + ":" + min + ":" + sec + timeday;
  24:  clocktimer = setTimeout("scroll()", 1000);
  25:  document.title = pagetitle + clocktext;
  26:  }
  27:  if (document.all) scroll();
  28:  // End -->
  29:  </script>

Status Bar Clock

Thursday, September 24th, 2009
   1:  <!-- STEP ONE: Put this code into the HEAD of your HTML document --> 
   2:   
   3:  <HEAD>
   4:  <SCRIPT LANGUAGE="JavaScript">
   5:  <!-- Original: Francis Woodhouse (francis@contessa.u-net.com) -->
   6:  <! >
   7:  <! >
   8:  <!-- Begin
   9:  function runClock() {
  10:  theTime = window.setTimeout("runClock()", 1000);
  11:  var today = new Date();
  12:  var display= today.toLocaleString();
  13:  status=display;
  14:  }
  15:  // End -->
  16:  </SCRIPT>
  17:   
  18:  <!-- STEP TWO: Put this code onLoad event handler in the BODY tag -->
  19:   
  20:  <body onLoad="runClock()">

Title bar clock

Friday, January 9th, 2009

<script language=”javascript”>
<!–
document.title = Date();
//–>
</script>

Dynamic clock

Friday, January 9th, 2009

<script LANGUAGE=”JavaScript”>
<!– Original:  Craig Lumley –>
<!– Begin
function MakeArrayday(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = “”;
}
return this;
}
function MakeArraymonth(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = “”;
}
return this;
}
function funClock() {
if (!document.layers && !document.all)
return;
var runTime = new Date();
var hours = runTime.getHours();
var minutes = runTime.getMinutes();
var seconds = runTime.getSeconds();
var dn = “AM”;
if (hours >= 12) {
dn = “PM”;
hours = hours - 12;
}
if (hours == 0) {
hours = 12;
}
if (minutes <= 9) {
minutes = “0″ + minutes;
}
if (seconds <= 9) {
seconds = “0″ + seconds;
}
movingtime = “<b>”+ hours + “:” + minutes + “:” + seconds + ” ” + dn + “</b>”;
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
clock.innerHTML = movingtime;
}
setTimeout(”funClock()”, 1000)
}
window.onload = funClock;
//  End –>
</script>
<span id=clock style=”position:relative;”></span>

Translate