Closed Thread
Results 1 to 10 of 10

Thread: {REQ} Eatsern Time Clock

  1. #1
    SEŅOR's Avatar
    SEŅOR is offline The Guy Everyone Hates SEŅOR is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    Toronto
    Posts
    2,319

    {REQ} Eatsern Time Clock

    Hello,

    I need a script that shows the current time in (GMT -5:00)Eastern Time for my site. I need it In if possible html/Javascript but php will do if it has to. Nothing to complicated just an example of how I want:

    Monday April 16, 6:49 PM

    Im offering 300 points., If more is needed, I will offer.

    Youtube Channel | Website

    // SEŅOR BERNS //

  2. #2
    Christopher's Avatar
    Christopher is offline Retired Christopher is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    USA
    Posts
    7,330

    Re: {REQ} Eatsern Time Clock

    http://www.javascriptmall.com/jsc/js...cks.htm#clock4
    Edit: See fixed code below
    I did not make this code. Just did a google search.
    Last edited by Christopher; 04-16-2007 at 07:52 PM.

  3. #3
    SEŅOR's Avatar
    SEŅOR is offline The Guy Everyone Hates SEŅOR is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    Toronto
    Posts
    2,319

    Re: {REQ} Eatsern Time Clock

    How does it work? BTW thta time is wrong, its 8:16 it says 7:16
    Last edited by SEŅOR; 04-16-2007 at 07:17 PM.

    Youtube Channel | Website

    // SEŅOR BERNS //

  4. #4
    Christopher's Avatar
    Christopher is offline Retired Christopher is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    USA
    Posts
    7,330

    Re: {REQ} Eatsern Time Clock

    Change var TimezoneOffset = -5 to var TimezoneOffset = -4.
    I'm guessing it has something to do with DST. And if you want the date, I'm working on getting it in there also.

    Put in header:
    Code:
    <SCRIPT Language="JavaScript">
    <!-- hide from old browsers
    function jsClockTimeZone(){
      // Copyright 1999 - 2001 by Ray Stott
      // OK to use if this copyright is included
      // Script available at http://www.crays.com/jsc
      var TimezoneOffset = -4  // adjust for time zone
      var localTime = new Date()
      var ms = localTime.getTime() 
                 + (localTime.getTimezoneOffset() * 60000)
                 + TimezoneOffset * 3600000
      var time =  new Date(ms) 
      var hour = time.getHours() 
      var minute = time.getMinutes()
      var second = time.getSeconds()
      var temp = "" + ((hour > 12) ? hour - 12 : hour)
      if(hour==0) temp = "12"
      if(temp.length==1) temp = " " + temp
      temp += ((minute < 10) ? ":0" : ":") + minute
      temp += ((second < 10) ? ":0" : ":") + second
      temp += (hour >= 12) ? " PM" : " AM"
      document.clockFormTimeZone.digits.value = temp
      setTimeout("jsClockTimeZone()",1000)
      }
    //-->
    </SCRIPT>
    Put in body
    Code:
    <BODY ONLOAD="jsClockTimeZone()">
    
    
    <FORM NAME="clockFormTimeZone">
    <FONT face="Courier New,Courier" size=4>
    <INPUT TYPE="text" NAME="digits" SIZE=11 VALUE="Loading">
    US Eastern Time
    </FONT>
    </FORM>
    Below is the body to use to include the date:
    Code:
    <BODY ONLOAD="jsClockTimeZone()">
    
    
    <FORM NAME="clockFormTimeZone">
    <FONT face="Courier New,Courier" size=4>
    <script language="Javascript">
    <!--
    /*
    Today's date script
    Visit java-scripts.net or 
    http://wsabstract.com for this script
    */
    
     var dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
    
     var monName = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
    
     var now = new Date
    
     document.write( dayName[now.getDay()] + " " + monName[now.getMonth()] + " "+now.getDate() +",")
    
    //-->
    </script>
    <INPUT TYPE="text" NAME="digits" SIZE=11 VALUE="Loading">
    
    </FONT>
    </FORM>
    Last edited by Christopher; 04-16-2007 at 07:51 PM.

  5. #5
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: {REQ} Eatsern Time Clock

    Quote Originally Posted by chougard View Post
    I'm guessing it has something to do with DST.
    Might have something to do with x10's timezone as well - if x10 was in the eastern time zone, you wouldn't need to adjust the time zone to display it in eastern. Had that glitch with the times on my site as well (to get it synced up with where I am, it's -1 if I'm remembering it right). Other webhosts had it as -2, +1, all depending where they were.


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  6. #6
    SEŅOR's Avatar
    SEŅOR is offline The Guy Everyone Hates SEŅOR is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    Toronto
    Posts
    2,319

    Re: {REQ} Eatsern Time Clock

    Can you somehow you cna make it, outside of the box, just text?

    Youtube Channel | Website

    // SEŅOR BERNS //

  7. #7
    Christopher's Avatar
    Christopher is offline Retired Christopher is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    USA
    Posts
    7,330

    Re: {REQ} Eatsern Time Clock

    I've been trying, but can't figure it out. I think that you would have to use a document.write command, but I'm not sure how.

  8. #8
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: {REQ} Eatsern Time Clock

    PHP Code:
    <?php
    $date 
    date('h:iA'time()+3600);
    echo(
    $date);
    ?>
    Last edited by Chris Z; 04-16-2007 at 09:51 PM.
    -Chris Z
    Retired Account Manager


  9. #9
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: {REQ} Eatsern Time Clock

    Use

    PHP Code:
    <?php

    date_default_timezone_set
    ("EST");

    echo 
    date("h:iA");

    ?>
    </span></span>
    Thanks,
    Brandon Long

  10. #10
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: {REQ} Eatsern Time Clock

    i guess that works too..
    Last edited by Chris Z; 04-16-2007 at 10:33 PM.
    -Chris Z
    Retired Account Manager


Closed Thread

Similar Threads

  1. fsockopen tends to time out?
    By t2t2t in forum Free Hosting
    Replies: 6
    Last Post: 03-23-2007, 08:08 PM
  2. Time out prob
    By elserge82 in forum Free Hosting
    Replies: 6
    Last Post: 11-29-2005, 07:04 PM
  3. Replies: 4
    Last Post: 09-04-2005, 03:27 AM
  4. More time to create website
    By -Daniel in forum Feedback and Suggestions
    Replies: 6
    Last Post: 07-03-2005, 04:34 PM
  5. Cannot acces website and forums most of time
    By dbforum in forum Free Hosting
    Replies: 20
    Last Post: 03-06-2005, 03:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers