Tags

,

Generate the timezone tables using the following command :

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

This needs to be done only after the OS level timezone patch is applied. Incase you dont have the timezone info, it can be downloaded @ http://dev.mysql.com/downloads/timezones.html

To check if your timezone patching is good, run the following sql and both the functions should return the same result.

SELECT CONVERT_TZ(‘2007-03-11 3:00:00′,’US/Eastern’,’US/Central’), CONVERT_TZ(‘2007-03-11 2:00:00′,’US/Eastern’,’US/Central’);

+————————————————————+————————————————————+
| CONVERT_TZ(‘2007-03-11 3:00:00′,’US/Eastern’,’US/Central’) | CONVERT_TZ(‘2007-03-11 2:00:00′,’US/Eastern’,’US/Central’) |
+————————————————————+————————————————————+
| 2007-03-11 01:00:00 | 2007-03-11 01:00:00 |
+————————————————————+————————————————————+

Happy Patching!

Advertisements