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

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images 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

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes 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
Change the Timezone for MySQL - PC✗3
Change the Timezone for MySQL

Change the Timezone for MySQL

Check the current timezone from MySQL:

SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);
image 3 - Change the Timezone for MySQL

OR

select now();
image 7 - Change the Timezone for MySQL

To check where the timezone is loaded from use:

SELECT @@session.time_zone;
SELECT @@global.time_zone;
image 4 - Change the Timezone for MySQL

If it is set to SYSTEM then it is using either timezone defined inside the my.cnf file or from the OS.

Check my.cnf:

grep time /etc/my.cnf
image 6 - Change the Timezone for MySQL

Check OS timezone:

date
image 5 - Change the Timezone for MySQL

You can set a different timezone on the OS and it will apply to mysqld after service restart, or to use different timezones for OS and for MySQL, set:

SET GLOBAL time_zone = '+8:00';
SET GLOBAL time_zone = 'Europe/Helsinki';
SET @@global.time_zone = '+00:00';
SET @@session.time_zone = "+00:00";

*Replace +8:00 and Europe/Helsinki with your timezone.

to make the changes permanent:

nano /etc/my.cnf

and under [mysqld] section add:

default-time-zone = "+00:00"

save the file and restart mysqld service.

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.