Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have changed time zone of my server to Asia/Kolkata in WHM by going to the following 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.

     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.

share|improve this question

closed as off-topic by HopelessN00b Jan 13 '15 at 23:59

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

This question appears to be off-topic because it is about working with a service provider's management interface, such as cPanel. – HopelessN00b Jan 13 '15 at 23:59
up vote 2 down vote accepted

You need to edit your php.ini (you can look for it under "PHP Configuration Editor" in WHM or manually at /usr/local/lib/php.ini) and set date.timezone = "Asia/Kolkata"

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.