Thoughts, stories and ideas.

In Denmark we practice summer- and winter time, also called daylight savings time. Twice a year we set the clock one hour forward or one hour back. When we set the clock one hour forward, whereby we lose one hour, it is due to the change from winter to summer time.

When we set the clock one hour back, we win an extra hour, which is due to the change from daylight saving time to winter time.

When is summer time?

Summer time starts on the last Sunday in March, when the watch jumps one hour forward at 2pm at night. The summer time ends again on the last Sunday of October at the same time when the clock is set one hour back.

Here you get an overview of when you should set the clock for the next 5 years.

• 2019 – The night between Saturday 30 March and Sunday 31 March
• 2020 – The night between Saturday 28 March and Sunday 29 March
• 2021 – The night between Saturday, March 27 and Sunday, March 28th
• 2022 – The night between Saturday, March 26 and Sunday, March 27th
• 2023 – The night between Saturday 25 March and Sunday 26 March

The problem is that Googles Cloud SQL for MySQL does not support automatic adjustment to daylight savings time , from the Google Documentation of Known bugs:

Automatic adjustment to daylight savings time is not supported; you must update the default_time_zone flag manually to account for daylight savings time.

In this blog-post I will cover how we can manually change this setting.

Change the database flags

Summer time:
Change the flag to:default_time_zone: +02:00

Winter time:
Change the flag to: default_time_zone: +01:00

Open the Cloud SQL Instance in the console and press “Edit”:

Google Cloud Platform showing an running MySQL Second Generation database

Unfold the “Add database flags”-section and the the value to accommodate the correct time:

Test your flags


Running the command SELECT CURRENT_TIME() in the app Querious on macOS