How to Convert UTC to Local Time Zone in MySQL

MySQL does not store time zone data when storing timestamps. It also uses the host server time as basis for generating the output of NOW();

To convert a timestamp from one time zone to another, you can use the CONVERT_TZ function:

-- using named time zones
SELECT CONVERT_TZ('2018-01-01 12:00:00','UTC','MET');

-- using offset time zones
SELECT CONVERT_TZ('2018-01-01 12:00:00','+00:00','+10:00');
database icon
Finally, a unified workspace for your SQL development
Get more done, together, with PopSQL and MySQL