MariaDB – Setting Europe/Athens Timezone

mariadbtimezone

I am using Debian 8, mariadb 10.4, nginx 10.3, php7.3-fpm.
My timezone configuration was like this:

  1. Debian: Europe/Athens ( through tzselect command )
  2. PHP: Europe/Athens , Default timezone UTC
  3. Mariadb: Europe/Athens

The problem:

My records where inserted on DATETIME fields with UTC timezone ( 3 hours earlier).

I guess it the default timezone on php that makes the problem, but I don 't know how to solve it.

Best Answer

DATETIME is like taking a picture of your local clock.

Check these:

SHOW VARIABLES LIKE '%zone%';

SELECT NOW();

If NOW() does not show Athens time, then something is set incorrectly.