I’m in the process of setting up a Zinnia blog on one of my Django sites. After putting all of the necessary plumbing in place I got the following message on first visiting the blog URL:
The solution to this is to copy your system’s time zone information across to the database.
Creating the Time Zone Tables
There’s a MySQL tool to do precisely this: mysql_tzinfo_to_sql. You just need to pass it the path to your system’s zoneinfo database. On my Ubuntu system the appropriate path is /usr/share/zoneinfo/.
The following command will read the contents of your system’s zoneinfo database, transform it into SQL statements and execute them in MySQL. You’ll need to provide the password for the root MySQL user.
You can just specify a single time zone, but it makes sense to me to simply load up the entire gamut.
The result is a set of tables in the mysql database.
MySQL Server Time Zone
You can check the time zone that’s configured for your MySQL server as follows:
So my MySQL server is using the same time zone as the system. We can lock that down by configuring a specific time zone for MySQL. Add the following to the end of /etc/mysql/my.cnf.