1๐
As explained in this article, MySQL uses (well what would it use otherwise) a table to store the timezones and how these are converted.
For some reason, this table might be truncated, and thus the conversion to a different timezone fails. It is a bit sad that the database then returns NULL
, and does not raise some error.
Anyway, a system usually has some tools to list the timezones. In Unix/Linux systems for example, that data is contained in the tz-info
package of most package managers. Files are then stored in the /usr/share/zoneinfo
directory to specify how these timezones are defined.
Azure MySQL databases have a stored procedure that can inspect the timezones on the system, and then fill the corresponding tables with information regarding these timezones. You can do this in a MySQL session with:
mysql> CALL mysql.az_load_timezone();
You might even want to run this command every now and then, to let the timezones keep in sync. Every now and then the specifics of some timezones change (slightly). MySQL will not look for the conversion to the data stored in the system, but in its tables.