I got a table with event time logs, and I need to convert 2 columns to a common timezone.
So if I do (convert to different timezones)
SELECT id
,CONVERT_TZ(starting_time, 'UTC', 'Europe/London') AS starting_time
,CONVERT_TZ(finishing_time, 'UTC', 'Europe/Madrid') AS finishing_time
FROM table
I got all the times, but if I run
SELECT id
,CONVERT_TZ(starting_time, 'UTC', 'Europe/London') AS starting_time
,CONVERT_TZ(finishing_time, 'UTC', 'Europe/London') AS finishing_time
FROM table
All the time data gets NULL
.
I loaded my TZ data with the information here https://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html from /usr/share/zoneinfo on RHEL 5 using MySQL 5.1.63.