MySQL Time Zones, time_zone

The MySQL server maintains several time zone settings:
  • System time zone. When the server starts, it attempts to determine the time zone of the host machine and uses it to set the system_time_zone system variable.
  • The server’s time zone. The global time_zone system variable. If you have SUPER privileges, you may: SET GLOBAL time_zone = timezone;. You may use: SELECT @@global.time_zone; to get its current value.
  • Per-connection time zones. Initially takes its value from time_zone, but the client can change its own time zone with: SET time_zone = timezone;. You may use: SELECT @@session.time_zone; to get its current value.
The ‘timezone’ values format:
  • 'SYSTEM' means: Same as the system’s time zone (read above).
  • A string indicating an offset from UTC, such as '+10:00' or '-6:00'. So for example, to set your current connection’s time zone to UTC, use: SET time_zone='+00:00'; (and if you change your mind, revert to using 'SYSTEM' time zone using: SET time_zone='SYSTEM';).
  • Named time zone, such as 'Europe/Helsinki', 'US/Eastern', or 'MET'. Can be used only if the time zone information tables in the mysql database have been created and populated!
More info at MySQL documentation here.