postgresql - 要更改 Azure PostgreSQL 托管数据库默认时区?

标签 postgresql azure timezone

我已经阅读了很多帖子,但对于将 Azure PostgreSQL 托管数据库时区从默认'UTC'更改为其他时区,我没有清楚的了解。

那么是否可以将 Azure PostgreSQL 托管数据库时区从 'UTC' 更改? 如果是的话,请您提出一个方法。

谢谢,xlr8

最佳答案

就目前情况而言,无法更改默认时区。这是一个被积压的功能 here .

您可以使用 AT TIME ZONE 根据时区转换时间

SELECT CONVERT(datetime, '03/29/2015 01:01:00')   
AT TIME ZONE 'Central European Standard Time';  
--2015-03-29 01:01:00.000 +01:00  

--Time between 02:00 and 03:00 is converted as +01!  
SELECT CONVERT(datetime, '03/29/2015 02:01:00')   
AT TIME ZONE 'Central European Standard Time';  
--2015-03-29 02:01:00.000 +01:00  

SELECT CONVERT(datetime, '03/29/2015 03:01:00')   
AT TIME ZONE 'Central European Standard Time';  
--2015-03-29 03:01:00.000 +02:00 

关于postgresql - 要更改 Azure PostgreSQL 托管数据库默认时区?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53750394/

相关文章:

node.js - 如何在ejs中获取本地时区?

匹配 postgresql bytea 的正则表达式

django - 是否可以将您自己的字符串添加到 Django SearchVectorField 中?

database - PostgreSQL 登录尝试失败

c# - azure 中的 HiQPdf.HtmlToImage HTML 布局错误

performance - 当服务器负载不大时,Azure API 时间缓慢/超时

azure - 502 - Web 服务器在 Azure Web 应用程序上充当网关或代理服务器时收到无效响应

c# - 如何使用 LINQQ 或任何其他方法更新数据表中所有行的第一列?

postgresql - 无法重新安装 PostgreSQL,因为 Windows 认为它​​仍然已安装

r - 如何更改R中的默认时区?