Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: need to change timezone for php

  1. #1
    Join Date
    Jan 2008
    Posts
    13

    Default need to change timezone for php

    I need to use date functine in php but the time zone of the server is not correct for me. How can I change it?

  2. #2
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,951

  3. #3
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,505

    Default

    A more practical solution would be setting it in a php.ini file in public_html if you have fastcgi enabled, or in a php.ini file in each directory that needs to be modified, rather than every php script.

    Code:
    date.timezone = "America/New_York"
    http://php.net/timezones

  4. #4
    Join Date
    Jan 2008
    Posts
    13

    Default

    I have not enabled fastcig, but I can edit the php.ini file, I have search for the line "date.timezone" but I can not find this line. Do you mean I should add an addition line date.timezone = "America/New_York" into the php.ini file?

  5. #5
    Join Date
    Feb 2006
    Location
    North of Boston, MA
    Posts
    1,658

    Default

    Exactly. FYI, the php.ini file is located in your public_html directory.
    redsox9 - Go Red Sox!!! 2004 and 2007 World Series Champions!
    Visit FenwayFanatics.com, home to Boston Red Sox baseball fans everywhere... now on Facebook and Twitter!

  6. #6

    Default

    can we not change the timezone in cpanel?

  7. #7
    Join Date
    Feb 2006
    Location
    North of Boston, MA
    Posts
    1,658

    Default

    If that's possible, I don't see it anywhere on the cPanel interface. Of course, I also don't see any mention of the current time.
    redsox9 - Go Red Sox!!! 2004 and 2007 World Series Champions!
    Visit FenwayFanatics.com, home to Boston Red Sox baseball fans everywhere... now on Facebook and Twitter!

  8. #8
    Join Date
    Dec 2007
    Posts
    10

    Default

    I, too, am trying to locate my php.ini file. I have recently enabled FastCGI, and attempted to "Install php.ini master file" through the PHP Config Panel. It claimed success, but I don't see the php.ini file anywhere in public_html. If I create my own php.ini and place it there, will it only override settings that I mention, or do I need to recreate the entire php.ini file?

  9. #9
    Join Date
    Dec 2007
    Posts
    10

    Default

    Looks like I found an answer to my question @ http://bluehostforums.com/showthread...hlight=php.ini

    and that the directives I put in that file will be added to existing php.ini settings.

  10. #10
    Join Date
    May 2008
    Posts
    20

    Default

    I followed the instructions to edit my php.ini. I dont think I have fastCGI enabled. I never enabled it myself and it does not appear in my cpanel.

    My problem is when I go to system info in Joomla and view PHP settings from there, the change I made to date.timezone does not show. It says no value.

    However if I run a script with phpinfo(); on the public_html directory it does reflect the change I made to date.timezone

    Any ideas?

Posting Permissions

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