How to Change timezone in cPanel Hosting with htaccess

1 Share = 1 Coffee to Writer

If your application hosted on cPanel Hosting server showing incorrect date or timezone and you do not have WHM access of your server then there are two ways to change timezone in cPanel. this error using your .htacess file within your cPanel account. We face various issues because of invalid timezone problem but the most common issue is to run a cronjob

Updating your timezone in cPanel from Php.ini

First of all you need to Access your cPanel hosting account and if your website is hosted with YouStable then you can access it thru https://www.youstable.com/manage.

Use top search box of your cPanel to find “Select Php Version” under the software section

timezone in cpanel
YouStable Shared Hosting Dashboard

This will redirect you to the Php version selection page, Here you need to click on “Switch to PHP Options” in the right side of the page

timezone in cpanel

You will able to see that there is an option date.timezone which allows you to change time zone of your website or any application you have installed on your server, if you are not aware about your country timezone find here: https://www.php.net/manual/en/timezones.php

timezone in cpanel

After making your correct choice click on “APPLY” button save the changes.

Change timezone using .htaccess

Many Web Hosting providers don’t support php.ini modification in those cases there is another way to change your website or server date and time by modifying your .htaccess file.

As you already logged in to your cPanel, find your apache configuration file under File Manage >> Public_html

Note: You will need to change settings because by default dot files are hidden for some security reasons

timezone in cpanel
UNHIDE .HTACESS FILE IN FILE

Now right click on the file and choose “EDIT” option to modify the configuration

timezone in cpanel

You may notice various config codes in this file all you have to do is scroll down to the bottom of the page and paste this code

# Adjust default time zone
SetEnv TZ America/Washington

Now to make changes “SAVE” the file and reload your page.

Leave a Comment

Show Buttons
Hide Buttons