Here in how to change the default Time Zone permanently in cPanel using the .htaccess file
Step 1. First, check you current time yone settings using a simple .php script like this:
<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "The time is " . date("h:i:sa");
?>
save it as timezone.php on your server and open the file in your browser, the output will be:
![current timezone in php current timezone in php](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/04/image-9.png?resize=547%2C176&ssl=1)
Step 2. Then, to change it, find your timezone format from this list of supported timezones by PHP
![PHP timezones of Europe PHP timezones of Europe](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/04/image-8.png?resize=736%2C355&ssl=1)
Step 3. In cPanel find and edit your .htaccess file and put the following code, but make sure to replace Europe/Belgrade with your timezone.
![cpanel htaccess file cpanel htaccess file](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/04/image-11.png?resize=627%2C480&ssl=1)
<IfModule php5_module>
php_value date.timezone ="Europe/Belgrade"
</IfModule>
Step 4. Save it and go back to the script in step 1. to check if the timezone was updated.
![timezone check php timezone check php](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/04/image-9.png?resize=547%2C176&ssl=1)
For more .htaccess snippets make sure to check out my .htaccess Cheatsheet
PS. For php.ini simply use the following:
date.timezone ="Europe/Belgrade"