Java Script

Title Bar Clock



Instructions: Paste this script anywhere in your HTML document. If you do not want to display the seconds, remove the blue line.

Tested On: IE 6, Mozilla 1.3, Opera 7

<SCRIPT LANGUAGE="JavaScript">
  <!-- Hide this from older browsers
  // This script was written by Protoplasm
  // http://www.geocities.com/protoplasm72  function display() {
    var Today = new Date();
    var hours = Today.getHours();
    var min = Today.getMinutes();
    var sec = Today.getSeconds();
    var Time = ((hours > 12) ? hours - 12 :( hours == 0) ? 12 :hours);
    Time += ((min < 10) ? ":0" : ":") + min;
    Time += ((sec < 10) ? ":0" : ":") + sec;
    Time += (hours >= 12) ? " PM" : " AM";
    document.title = Time;
    setTimeout("display()",1000);
  }

  display();

  // end hide -->
</SCRIPT>

Share

Thanks for reading my blog. If you like what I write, why not subscribe to my feed?

If you are busy, I can send the latest post to your email. Just subscribe to my email updates.

 

Enter your email address:

Delivered by FeedBurner

Discussion

No comments for “Title Bar Clock”

Post a comment