I have a MySQL database (hosted on Ubuntu) that has a table with a time zone. This date is in the UTC time zone. I have an application that uses this data, but you need to convert the time from UTC to PST in order to display the data in a useful format.
This can probably be changed at the application level, but I don’t have time for this, so I want to use convert_tzit to get the correct time zone until I have time to change the application to convert the time zone.
However, when I do something like
SELECT id,
category,
convert_tz(create_datetime, 'UTC', 'PST') as create_datetime
FROM table
I get a result like
1, category, NULL
I know that I need to load timezone tables, so I did by running this command:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
mysql. convert_tz NULL. - ?
!