How to set default Timezone via htaccess in cPanel? Serverhosthub – The Hosting Platform Made For You – Go Online With Hosting serverhosthub | free hosting | Linux shared hosting | Hosting | Free domain | Life time Free ssl certificate | Chepest web hosting | Low price hosting | Domain Transfer

Here in this article we will describe you “How to Change Default Time Zone Permanently in cPanel via .htaccess File”.

Live Video Tutorial- How to set default timezone via htaccess in cPanel?

Follow the steps to set the default timezone in cPanel:

Phase 1 login to your cPanel Dashboard

Phase 2 click on file manager section and visit public_html

how to set default timezone via htaccess in cPanel?

how to set default timezone via htaccess in cPanel?

step 3 Create a file named testing.php or test.php

how to set default timezone via htaccess in cPanel?

step 4 Now right click on the file and select Edit

how to set default timezone via htaccess in cPanel?

Step::5 enter the code below

<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "The time is " . date("h:i:sa");
?>

Step::6 now again public_html and edit .htaccess file. If you can’t find the .htaccess file inside your public_html, just create one

how to set default timezone via htaccess in cPanel?

Step::7 Once you have the .htaccess file, place the code below

<IfModule php5_module>
 php_value date.timezone ="Asia/Kolkata"
</IfModule>

how to set default timezone via htaccess in cPanel?

Don’t forget to save the files.

Now try to open this test.php file in a new tab. You will find that your website is showing the correct time.

how to set default timezone via htaccess in cPanel?

Thank you for reading this article… we hope it was helpful to all of you!!