Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript clock

    Hi,
    I've just spotted this forum and I am glad I did. I am in a desperate need of a clock program made in javascript. I need a clock that will show a time 12x faster (or 15x or whatever). What I mean is that if a set the clock starting date to January 1st 2000 and tommorrow I visit my website and its January the 2nd 2000 the clock will show JANUARY 13th 2000. Of course thats if we assume that both viewing times in Jan. 1st and 2nd were at noon (12 o'clock). So here is what I mean
    12:15:00 1/1/2000 (today)
    12:15:00 13/1/2000 (tommorow). Of course if only one hour passes it will show as if 12 hours passed. But please if anyone makes this script please mark the acceleration (12x, or whatever ration you use), bold it or whatever so I can edit it to suit my needs. And also don't make a clock that will show 12x the time now, I need a clock were I input a start date and then when I come back an hour later it'll show as if I was 12 hours away. If anyone could make this I would be most grateful. I tried to make it myself, but I end up with a time like 14:25:240, the seconds then go +12 until they reach 60 times 12 and of course I failed.

    Thank you very much, even if you just read my post I am still thankfull

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,516
    Thanks
    3
    Thanked 505 Times in 492 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    var ToDay=new Date();
    var Start=ToDay.getTime();
    
    
    function AccelTime(by){
     document.Show.Show0.value=ToDay.toUTCString();
     var now=new Date().getTime();
     document.Show.Show1.value=new Date(((now-Start)*by)+Start).toUTCString();
     setTimeout('AccelTime(10)',1000);
    }
    
    
    //-->
    </script>
    </head>
    
    <body onload="AccelTime(12);">
    <form name=Show id=Show style="position:absolute;visibility:visible;top:450px;left:0px;" >
    <input size=100 name=Show0 >
    <input size=100 name=Show1 >
    </form>
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Bless you! Thank you very very much!!!


  •  

    Posting Permissions

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