Search code examples
google-cloud-sql

Change timezone in cloud sql


I have created a SQL instance on Google Cloud and I need to change the timezone. I already seen documentation, and I added the flag default_time_zone and set the value to 06:00, but the console doesn't let me write the semicolon.

How can I write the value? Thanks in advance.


Solution

  • The proper format for the default_time_zone flag is +/-HH:MM e.g. to set it to GMT+6 you would write the value +06:00. Don't forget the leading zero.

    To modify the timezone, update the Google Cloud SQL flag named default_time_zone. This or any other database flag can be updated as follows:

    1) In the Google Cloud Platform Console, open an existing project by selecting the project name.
    2) Open the instance and click Edit.
    3) Scroll down to the Flags section.
    4) To set a flag that has not been set on the instance before, click Add item, choose the flag from the drop-down menu, and set its value.
    5) Click Save to save your changes.
    6) Confirm your changes under Flags on the Overview page.

    When you add or modify these flags, your instance will automatically restart. Note that you cannot modify flags on failover replicas.

    For further reading, see the documentation for setting Cloud SQL Flags.