sql - 如何更改 Amazon Redshift 中的默认时区?

标签 sql amazon-web-services amazon-redshift

默认情况下将时间戳列设置为 SYSDATE,将其存储为 UTC .是否可以更改时区,以便 SYSDATE 将日期和时间存储到不同的时区?

到目前为止,我已经检查了 SET命令,但我不确定是否可以使用它来更改时区。

最佳答案

基本上,答案是否定的。根据documentation :

TIMESTAMP values are UTC, not local time, in both user tables and Amazon Redshift system tables.

Note Timestamps with time zones are not supported.



如果您需要查询返回不同时区的数据,您可以使用 CONVERT_TIMEZONE函数,使用常量时区值(或查询参数),或将结果加入包含所需时区的配置表。

关于sql - 如何更改 Amazon Redshift 中的默认时区?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36338266/

相关文章:

php - 当我尝试将 magento 网站从服务器迁移到本地主机时出现错误

amazon-web-services - VPC SSL/HTTPS 环境

amazon-web-services - 错误 : "network_interface": conflicts with vpc_security_group_ids

c# - 将参数传递给 AWS Lambda 函数

amazon-web-services - Redshift : How can I generate a series of numbers without creating a table called "numbers" in redshift (Postgres 8. 0.2)?

type-conversion - Redshift : milliseconds to timestamp

python - 用 null python pandas 替换 NaN

mysql - 在使用 MySql 维护组的同时进行排序

MySQL : Use IF in TRUNCATE

sql - 如何查询所有从商店购买的用户知道他们的订单