---
title: "How to Change Your Default Timezone in .htaccess"
description: "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..."
url: https://www.inmotionhosting.com/support/website/htacess-change-timezone/
date: 2012-11-16
modified: 2021-08-16
author: "Scott Mitchell"
categories: ["Website"]
type: post
lang: en
---

# How to Change Your Default Timezone in .htaccess

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](/support/website/set-timezone-in-php/).

## Changing your Default Timezone:

1. [Log into your cPanel](/support/edu/cpanel/how-to-log-into-cpanel/).
2. PL_fix_Selection_01.png Find the **Files **category and click on the **File Manager** icon.[![cpanel](https://www.inmotionhosting.com/support/wp-content/uploads/2012/07/cpanel_lanternUpdatesMay17_cmPape_01.png)](/support/wp-content/uploads/2012/07/cpanel_lanternUpdatesMay17_cmPape_01.png)  
3. settings image Selection 3Click **Settings** at the top right corner. [![cpanel](https://www.inmotionhosting.com/support/wp-content/uploads/2012/11/cpanel_plfix_PL_fix_Selection_03.png)](/support/wp-content/uploads/2012/11/cpanel_plfix_PL_fix_Selection_03.png)
4. 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](https://www.inmotionhosting.com/support/wp-content/uploads/2012/07/cpanel_plfix_PL_fix_Selection_02.png)](/support/wp-content/uploads/2012/07/cpanel_plfix_PL_fix_Selection_02.png)  
5. Look for the *.htaccess* file and right click on it. This brings up a menu. Find and click on the **Edit **option. PL_fix_Selection_04.png [![file-manager-htaccess](https://www.inmotionhosting.com/support/wp-content/uploads/2012/07/cpanel_plfix_PL_fix_Selection_04.png)](/support/wp-content/uploads/2012/07/cpanel_plfix_PL_fix_Selection_04.png)  
6. 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`
7. Be sure to hit the **Save Changes** button in the upper right corner to save your new htaccess configuration.
