更改Google Cloud SQL CURRENT_TIMESTAMP时区? [英] Change Google Cloud SQL CURRENT_TIMESTAMP time zone?

查看:198
本文介绍了更改Google Cloud SQL CURRENT_TIMESTAMP时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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-标志

  1. 转到Google Developers Console.
  2. 创建一个新的Developers Console项目,或打开一个现有项目 通过单击项目名称.
  3. 在左侧的边栏中,单击存储> Cloud SQL以显示列表 该项目的Cloud SQL实例数量.
  4. 打开您的实例,然后单击编辑".如果您需要创建一个新的 实例,请单击新实例".
  5. 向下滚动到"MySQL标志"部分.
  6. 从下拉菜单中选择标志并设置其值.
  7. 单击保存".您可以在 概述页面.
  1. Go to the Google Developers Console.
  2. Create a new Developers Console project, or open an existing project by clicking on the project name.
  3. In the sidebar on the left, click Storage > Cloud SQL to show a list of Cloud SQL instances for the project.
  4. Open your instance and click Edit. If you need to create a new instance, click New instance.
  5. Scroll down to the MySQL Flags section.
  6. Choose flags from the drop-down menu and set their values.
  7. Click Save. You can check your flags under MySQL Flags on the overview page.

这篇关于更改Google Cloud SQL CURRENT_TIMESTAMP时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆