Change Your Websites TimeZone Using .htaccess
Do you need to change the timezone that your website is running on because you have set up a cron job or just have a clock with the local time on your website? well In this Post, we will show you how to change the timezone of your website using the .htaccess file.
Changing Your Websites Timezone with .htaccess File
Before we you go further, make sure you know what code your timezone is and what you want to use for your website. You can refer the PHP Site for a list of available timezones “Here”.
Also if you are not familiar with or have not setup your FileZilla Client to connect to your website files follow our other tutorial “Here“.
How to Located Your .htaccess File Through FileZilla
your .htaccess file is found within your public_html folder within your hosting account. it is usually always located in the root directory of your website.
The picture below is taken from FileZilla FTP.
How to Change Your Websites Timezone
- Connect to the server and find .htacess file, right-click and press View/Edit.
- Once your editor has opened, copy this code and past it into your .htaccess file :
PLEASE NOTE: If you have any existing code in your .htaccess file you will need to add this “Above” your other .htaccess rules.
php_value date.timezone "Australia/Sydney"
NOTE: Replace “Australia/Sydney” with your preferred timezone.
When Complete Save your .htaccess and within a few moments you will be prompted by FileZilla to Upload the File back to the Server as seen in the image below.
- Check the Option to “Finish editing and delete local file” and then click Yes.
- The file will now be uploaded to your server. If FileZilla asks you to overwrite the file make sure you click overwrite and your all done.
This is a very simple process but most are not familiar with how to accomplish this. If all else fails please feel free to contact us via a “Support ticket”. and we will do our best to assist you with any problems that you may occur.
We hope this How-to has helped you. if you think I have missed anything please feel free to leave a comment below