Search
Sponsors

Title bar clock



   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>

Related posts:

  1. Status Bar Clock 1:
  2. Temperature Conversion 1:

Related posts brought to you by Yet Another Related Posts Plugin.



Tags: ,

Leave a Reply

Translate