4

I'm developing an app that meant to run only in Israel. All of our tables contains times at Israeli time (Tel Aviv time).

because the SQL in GCP doesn't support default timezone and time zone convert I got stuck.

how can I convert times between time zones?

let me remind you that Israel has a light saving time change.

Roham Rafii
  • 2,929
  • 7
  • 35
  • 49
Dor Shay
  • 53
  • 1
  • 5
  • Look at [this Post][1] for all about mysql Time Zones. [1]: http://stackoverflow.com/questions/930900/how-to-set-time-zone-of-mysql – SOehl Mar 05 '15 at 19:26

3 Answers3

8

Now you have the ability to set the time zone in Cloud SQL. See https://cloud.google.com/sql/docs/mysql-flags. The limitation is that the time zone needs to be specified as offsets to UTC, such as '+10:00'. It does not support named time zones like 'Europe/Helsinki'.

Tony Tseng
  • 479
  • 2
  • 6
  • 3
    So this means one have to do the Daylight Saving Time manually? – Razvan Grigore Jul 02 '19 at 16:15
  • @RazvanGrigore yes, unfortunately. This is a known issue at this time. My team is currently having to switch the default_time_zone during DST. We're hoping to get it into UTC soon so we don't have to do this. _"Automatic adjustment to daylight savings time is not supported; you must update the default_time_zone flag manually to account for daylight savings time."_ https://cloud.google.com/sql/docs/mysql/known-issues#administrative_issues – munzld Sep 26 '21 at 17:31
0

Cloud SQL now supports named time zones. See a list here: https://cloud.google.com/sql/docs/mysql/flags#timezone-names

When using timezone names, automatic adjustment to daylight saving time is supported.

What is weird is that even though when explaining named time zones it gives the example Europe/London, in the actual list that's missing. The closest equivalent is Europe/Dublin, which is functionally the same although their summer time is considered "standard" so they switch to winter time.

Ecuador
  • 1,014
  • 9
  • 26
-1

THIS ANSWER IS OBSOLETE

On Google Cloud SQL you cannot currently set your own time zone. If you need to change the time zone on your instance, please get in touch with cloud-sql@google.com.

Chris Calo
  • 7,518
  • 7
  • 48
  • 64
David
  • 9,288
  • 1
  • 20
  • 52