How To Change cPanel Default Time Zone

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, 

Changing your Default Timezone:

    1. Log into your cPanel. 
    2. Find the Files category and click on the File Manager icon.
      cpanel
    3. Click Settings at the top right corner.
cpanel
  1. Select the Document Root for your domain and be sure the checkbox next to Show Hidden Files is checked. Click the Save button.
    file-manager-show-hidden
  2. Look for the .htaccess file and right click on it. This brings up a menu. Find and click on the Edit option.
    file-manager-htaccess
  3. 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
  4. 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!
  • 111 Users Found This Useful
Was this answer helpful?

Related Articles

How To Create a new Webmail Account on cPanel

To create an email account on your cPanwel: Log into cPanel using your cPanel username and...

5 Important Things to Consider When Choosing a Domain for Your Business or Website

When first setting up any website, one of the hardest — but most important — things to decide is...

How To Disable MySQL Strict Mode

It is important that MySQL Strict Mode is disabled for the proper operation of Sendroid...

How To Create an A-Record in cPanel

Let's start with a brief explanation of DNS. DNS stands for Domain Name System. It converts human...

How To Enable or Disable Shell_exec in PHP

First you need to find the location of PHP.ini. You will need to have root access to your server...