When working with programs that use php, you may notice that the timezone on the site is off. This is because the timezone is set for the location of your hosting server, either on the East or West coast of the United States. If you prefer to have your timezone set for another locale in the world due to your targeted clientele, you will want to change the timezone in your php.ini file. Below is a quick guide to doing that in your hosting account.

Setting the timezone in your php.ini file

  1. Log into your cPanel interface.
     
  2. Using your File Manager, locate and then open your php.ini file for editing.
     
  3. inserted code in php.iniAdd the following line of code to top of your php.ini file

    date.timezone = "US/Pacific"

     
  4. Replace the value US/Pacific with the timezone from the lists found here for your desired timezone.
     
  5. Click the Save Changes button found in the upper right corner of the screen.
     
  6. Now, you can check your phpinfo.php page to verify the change took place. Below is a before and after of the setting in the php.ini file.
    BeforeAfter
     before the timezone edit  after the php.ini edit
     
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Comments

n/a Points
2017-08-01 7:45 am

Nice tutorial. This tutorial was really useful to set timezone in php file.

Thanks.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}