更改Google Cloud SQL CURRENT_TIMESTAMP时区? [英] Change Google Cloud SQL CURRENT_TIMESTAMP time zone?
问题描述
我在Google Cloud SQL中使用CURRENT_TIMESTAMP
,并根据 Google ,它返回服务器的当前时间.
I'm using CURRENT_TIMESTAMP
in Google Cloud SQL and according to Google, it returns the server's current time.
当前,随着时间的流逝,它看起来就像服务器的UTC -1(即在大西洋).这不是很有帮助.
Currently, with the time that it returns, it looks like the server's at UTC -1 (i.e., in the Atlantic Ocean). This is not very helpful.
我每次致电CURRENT_TIMESTAMP
时,如何更改时区并显示正确的时间(即我自己选择的时区)?
How do I change the timezone and have it display the right time (i.e., a time zone of my own choosing) whenever I call CURRENT_TIMESTAMP
?
推荐答案
有一种更改Google Cloud SQL时区的新方法 https://stackoverflow.com/a/29758598/4121388
There is a new way to to change Google cloud SQL time zone https://stackoverflow.com/a/29758598/4121388
说明: https://cloud.google.com/sql/docs/mysql-标志
- 转到Google Developers Console.
- 创建一个新的Developers Console项目,或打开一个现有项目 通过单击项目名称.
- 在左侧的边栏中,单击存储> Cloud SQL以显示列表 该项目的Cloud SQL实例数量.
- 打开您的实例,然后单击编辑".如果您需要创建一个新的 实例,请单击新实例".
- 向下滚动到"MySQL标志"部分.
- 从下拉菜单中选择标志并设置其值.
- 单击保存".您可以在 概述页面.
- Go to the Google Developers Console.
- Create a new Developers Console project, or open an existing project by clicking on the project name.
- In the sidebar on the left, click Storage > Cloud SQL to show a list of Cloud SQL instances for the project.
- Open your instance and click Edit. If you need to create a new instance, click New instance.
- Scroll down to the MySQL Flags section.
- Choose flags from the drop-down menu and set their values.
- Click Save. You can check your flags under MySQL Flags on the overview page.
这篇关于更改Google Cloud SQL CURRENT_TIMESTAMP时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!