setting timezone for MySQL using PHPMyAdmin

Accordingly with this question

SET SESSION time_zone = '+8:00'

TIMESTAMP values are converted to UTC when inserted into the DB and converted back to the current timezone set in MySQL on retrieval. The other answers show how to set the timezone in MySQL which will determine what value comes out of the database.

Another option is to use a DATETIME column, store ALL of your dates in UTC, and convert them to the desired timezone in your application (PHP or wherever you get the values from).


This has to do with MySQL's timezone.

You can set it per connection (e.g. via PHPMyAdmin) with the following:

SET time_zone = timezone;

However, this will reset if MySQL restarts. So it is better set at the server level. Which, I assume, you can't.

I encourage you to read more from the MySQL Docs.