default_time_zone

2,077 views
Skip to first unread message

Silambarasan Sekar

unread,
Mar 12, 2018, 6:45:39 AM3/12/18
to Google Cloud SQL discuss
Hi Team,
We are using Cloud SQL (mysql) second generation. We want our Cloud SQL instances to have Central Timezone.
The instances were have a database flag as "default_time_zone" as '-06:00' till now, since the day light started yesterday, we have to manually change the database flag of 'default_time_zone' to -05:00. The same happened on Nov 4th of 2017. 

The question I wanted to ask is, "Do we have to manually change the default_time_zone twice a year because of the day light savings or is there a mechanism in place that I am not aware of which will take care of this automatically." Thank you!


Thanks & Regards
Venu

Ani Hatzis

unread,
Mar 12, 2018, 9:04:36 AM3/12/18
to google-cloud...@googlegroups.com
I believe that it usually makes most sense to save timestamps as UTC/GMT values in a database, that would be "default_time_zone = +00:00" (see MySQL Server Time Zone Support). Instead let the application logic do convert from/to a user's preferred time-zone in all interfaces and work internally with UTC values (and with the database).

There are timezone libraries that will help you with this. This domain is quite messy and daylight saving rules change all the time. And with UTC you wouldn't need to tinker with the timezone offset manually.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/f3ca251a-335c-43c6-ba8b-cf39fcd54ea4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nau...@google.com

unread,
Mar 13, 2018, 12:28:36 PM3/13/18
to Google Cloud SQL discuss
Hello 

As you are already aware that you can set the offsets using the 'default_time_zone' flag [1], but this does not support daylight savings.

Currently, named time zones (for example, "Europe/Helsinki") are not supported. The documentation: MySQL Server Time Zone Support documentation[2] seems to work for first generation Cloud SQL instance. If you want this feature to support Named Time zone supporting daylight savings, I would suggest you to open a feature request using the public issue tracker[3].

Silambarasan Sekar

unread,
Mar 15, 2018, 7:11:37 AM3/15/18
to Google Cloud SQL discuss
I have raised the issue in public issue tracker #74600960. Thank you!

Thanks & Regards
Venu

Montassar Dridi

unread,
Nov 1, 2018, 11:45:22 AM11/1/18
to Google Cloud SQL discuss
did you get a solution for your issue ? 

Amit (Google Cloud Support)

unread,
Nov 1, 2018, 5:41:49 PM11/1/18
to Google Cloud SQL discuss

Hello Montassar


A feature request has been created in Issue Tracker for this case. Which is also been forwarded to the Cloud SQL Engineering team for evaluation, however there is not an ETA at this moment. You should follow this issue tracker link for all future updates.

José Pérez Bautista

unread,
Oct 31, 2019, 11:42:15 AM10/31/19
to Google Cloud SQL discuss
You can use something like:

SET GLOBAL time_zone = 'Europe/Paris';

In a cron task to be sure you are in the right timezone (summer and winter time).
Reply all
Reply to author
Forward
0 new messages