MySQL time zone

Skip to main content
Du bist hier:
Drucken

MySQL time zone

Customize MySQL timezone

MySQL offers countless functions that interact with a date or time. Also the current time can be read with NOW(). Our servers use by default the timezone ‘Europe/Zurich’. But if you want to use a custom timezone it is possible to set it at the beginning of a session. Use the following commands directly after the connection is established:

[code language=”sql”] SET SESSION time_zone = ‘+1:00’; // oder SET SESSION time_zone = ‘Europe/Helsinki’;<br />SELECT @@global.time_zone, @@session.time_zone, @@system_time_zone, NOW(); [/code]

Now all commands following in this session are processed in the time zone just set.

Tags:
Related Post