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 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts

    Question TimeZone For Atlanta

    Hello


    I was wondering what setting I have to put in my PHP script so that I can get my timezone set to Atlanta (http://www.timeanddate.com/worldclock/city.html?n=25)

    I dont seem to find it on the php.net site (http://www.php.net/manual/en/timezones.america.php)

    Thanks

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    use a "major city" like

    PHP Code:
    <?php
    date_default_timezone_set
    ('America/New_York');
     echo 
    date('D,F j, Y, h:i:s A');
    ?>
    or even try

    PHP Code:
    <?php
    date_default_timezone_set
    ('America/Atlanta');
     echo 
    date('D,F j, Y, h:i:s A');
    ?>
    cant tell you if it works with atlanta but its worth a shot

  • #3
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    hey America/New_York worked, thanks

  • #4
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    Question:

    It works fine on my localhost but when I upload the same code, it shows me a time which is off by 1 hour.

    Any idea whats happening?

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Maybe it isn't accounting for daylight savings properly?
    OracleGuy

  • #6
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    Assuming that is the case, How do fix it then?

  • #7
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    Any update on this will be appreciated

  • #8
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    Question: How do I maintain daylight savings using php?

  • #9
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Quote Originally Posted by cancer10 View Post
    Question: How do I maintain daylight savings using php?
    I don't know much about the php time zone function but I assume you would have to create an if statement. If the current date is between the dates that daylight savings is in affect then you add the hour, or subtract.



    ------
    Leonard Whistler

  • #10
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Len Whistler View Post
    I don't know much about the php time zone function but I assume you would have to create an if statement. If the current date is between the dates that daylight savings is in affect then you add the hour, or subtract.



    ------

    Hi

    I dont want to sound like a nerd but can you please tell me what is a "daylight saving"?

  • #11
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Quote Originally Posted by cancer10 View Post
    Hi

    I dont want to sound like a nerd but can you please tell me what is a "daylight saving"?
    That's when the clocks are moved forward - or backward - one hour to give us extra sunlight during the winter. I think it's from October to April. Some Countries don't bother with it.



    ----
    Last edited by Len Whistler; 01-27-2010 at 07:32 AM.
    Leonard Whistler


  •  

    Posting Permissions

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