The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing default time zone using WHM / cPanel

Discussion in 'General Discussion' started by iSumitG, Dec 31, 2012.

  1. iSumitG

    iSumitG Member

    Joined:
    Apr 15, 2012
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have changed time zone of my server to "Asia/Kolkata" in WHM by going to the path:
    Home > Server Configuration > Server Time

    But still my website is showing timezone as "America/Denver" when I check it using PHP.

    I have pasted the following code in test.php file in public_html directory of my domain.

    PHP:
    echo 'Time zone is: '.date('e');
    echo 
    'Time zone is: '.date_default_timezone_get();
    I have 3 websites on my server, all of them having the same problem. What should be done to get the time zone same as WHM in all websites?

    Two solutions can be to set a default timezone using PHP or .htaccess. But I want to know why default timezone is not showing as Asia/Kolkata even if server timezone is set to Asia/Kolkata in WHM.
     
    #1 iSumitG, Dec 31, 2012
    Last edited: Dec 31, 2012
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can change PHP's time zone by clicking Home » Service Configuration » PHP Configuration Editor, and clicking the Advanced Mode radio button. The setting to change is date.timezone. This applies to all sites on the server unless overridden by custom php.ini files.
     
  3. biswebteam

    biswebteam Registered

    Joined:
    Oct 9, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi,

    I have tried it but I don't see the Advanced Mode radio button. Do I go to WHM or CPANEL?
     
  4. theoxgr

    theoxgr Member

    Joined:
    Oct 3, 2013
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Greece, Thessaloniki
    cPanel Access Level:
    Root Administrator
    you have to go to WHM because this is a universal PHP change that will affect all cpanel accounts.
     
  5. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You will need to ask your host to do this for you. A reseller is not going to have access to this function.
     
  6. TraderStf

    TraderStf Member

    Joined:
    Feb 27, 2014
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Belgium
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page