How to Change Your Default Timezone

There have been some updates to our servers and the way cPanel works to make it much easier to adjust the timezone than before. You can adjust the timezone in cPanel > Select PHP Version and then Switch to PHP Options to the top right. Here you would change the value of the date.timezone field to any of the following - https://sharkhosting.co.uk/knowledgebase/96/Timezone-Reference-List.html. As an example just type: Europe/London into that field and make sure to save changes.

Alternatively, you can update your .htaccess file. The instructions of which are below:

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 behaviour 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 datacentre 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.

Log into your cPanel.

Find the Files category and click on the File Manager icon.

cpanel

Click Settings at the top right corner.

cpanel

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

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

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

Be sure to hit the Save Changes button in the upper right corner to save your new htaccess configuration.


For more timezones
go to our "Timezone Reference List".


Congratulations, now you know how to change your default timezone in the .htaccess file!

  • 30 Users Found This Useful
Was this answer helpful?

Related Articles

How to update your cPanel Contact Information or receive a notification on reaching quota limit?

If you want to receive notification on reaching your disk quota, bandwidth usage limit, reaching...

How to Change cPanel Style/Theme?

Switching over to another cPanel theme with a different style is easy and there are two ways to...

How to Edit file in the cPanel File Manager?

1. Log into your cPanel account.2. In the "Files" section, click on "File Manger" Icon. 3....

How to Change Language of your cPanel?

cPanel supports a lot of languages, and if you want to change your cPanel language to your native...

How to Reset my cPanel Account Password?

If you can access your cPanel account, follow these steps to reset your password:1. Log into your...