Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
Set default Timezone via htaccess in cPanel - PC✗3
Set default Timezone via htaccess in cPanel

Set default Timezone via htaccess in cPanel

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

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

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
<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

For more .htaccess snippets make sure to check out my .htaccess Cheatsheet

PS. For php.ini simply use the following:

date.timezone ="Europe/Belgrade"
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.