InMotion Hosting Support Center

The .htaccess file is a hidden text file within your hosting account that can be very powerful. It is designed so that you can modify it to change the behavior of your website that normally would take higher access beyond your account. It acts as a liaison between your domain and the server and can perform many functions.

The server has a specific time setting. This is usually based on the servers physical location, for example, if the datacenter that houses the server is located in California, the server will most likely be set to the Pacific Time. Some sites may cater to specific areas of the world and wish to use the timezone for that area. PHP has configuration files that can do this, but what about other tiles such as HTML or Log files? That is where the htaccess comes into play. Below are instructions for changing the base timezone in your local htaccess file.

When using PHP 5.3 or newer, you may be required to set the timezone in the php.ini file, which is explained in our guide titled Setting the timezone for php in the php.ini file.

Changing your Default Timezone:

  1. Log into your cPanel. 
  2. Find the Files category and click on the File Manager icon.
  3. Click Settings at the top right corner.
  4. cpanel
  5. Select the Document Root for your domain and be sure the checkbox next to Show Hidden Files is checked. Click the Save button.
  6. Look for the .htaccess file and right click on it. This brings up a menu. Find and click on the Edit option.
  7. Now that you are in the htaccess editor, paste the following code at the top of the page to configure your account. In this example, we are setting the timezone to Eastern Standard Time.
    #Adjust default time zone
    SetEnv TZ America/Washington
  8. Be sure to hit the Save Changes button in the upper right corner to save your new htaccess configuration.

Congratulations, now you know how to change your default timezone in the .htaccess file!
Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

n/a Points
2018-07-31 4:28 am

Required to change time zone in hosting , please help me

11,000 Points
2018-07-31 8:10 am
The instructions in this article should be able to help. Are you getting a specific error? Was there are a part of these instructions you had trouble with?
n/a Points
2017-10-22 4:49 am

You can change your php version in Whm panel MutltiPHP page.


Post a Comment

Email Address:
Phone Number:

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

4 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

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

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!