Results 1 to 3 of 3

Thread: Multiple live clocks on page....

  1. #1
    Join Date
    Sep 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Multiple live clocks on page....

    I would like to have several (5) live clocks on my homepage, each displaying the time for a different city.
    Does anyone know where I can get the script for this or how to do it.
    Thanks for your help.
    Regards
    Darryll

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You can use this script, the line in bold is how many hours you want taken on or off the system time. The script is c/o javascript.internet.com


    <!-- TWO STEPS TO INSTALL BASIC CLOCK:

    1. Add the onLoad event handler into the BODY tag
    2. Copy the coding into the BODY of your HTML document -->

    <!-- STEP ONE: Insert the onLoad event handler into your BODY tag -->

    <BODY onLoad="clock()">

    <!-- STEP TWO: Paste this code into the BODY of your HTML document -->

    <!-- Adjust the placement of the clock in the line below -->
    <span id="pendule" style="position:absolute;left:300;top:20;"></span>

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original: Xavier R. (xav@lougaou.com) -->
    <!-- Modified: Benjamin Wright, Editor -->
    <!-- Web Site: http://www.lougaou.com/ -->

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    function clock() {
    if (!document.layers && !document.all) return;
    var digital = new Date();
    var hours = digital.getHours();
    var minutes = digital.getMinutes();
    var seconds = digital.getSeconds();
    var amOrPm = "AM";
    if (hours > 11) amOrPm = "PM";
    if (hours > 12) hours = hours - 12;
    if (hours == 0) hours = 12;
    if (minutes <= 9) minutes = "0" + minutes;
    if (seconds <= 9) seconds = "0" + seconds;
    hours = hours + 1
    dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
    if (document.layers) {
    document.layers.pendule.document.write(dispTime);
    document.layers.pendule.document.close();
    }
    else
    if (document.all)
    pendule.innerHTML = dispTime;
    setTimeout("clock()", 1000);
    }
    // End -->
    </script>

    <!-- Script Size: 1.42 KB -->

    Regards,
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  3. #3
    Join Date
    Jan 2009
    Location
    In a house
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Not trying to sound like an idiot here, but I am fairly new. I found your reply through the forum and am wondering:

    How do you make the "five" clocks appear?

    I can get the script to work, but only one clock appears. Any advice would be greatful.

    Hopibuddha

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •