Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何找到为 Azure Synapse(SQL DWH) 设置的当前时区。我已经尝试过 CURRENT_TIMEZONE(),但似乎 Synapse 不支持它。还有其他功能可以找到相同的吗?
问候,桑迪普
您可以使用以下方法获取时区偏移量:
SELECT DATEPART(tzoffset, SYSDATETIMEOFFSET())
这将返回一个 int 值 [ex: 0 for UTC],因此您可以在 CASE 或后续查找中使用它。它不像 CURRENT_TIMEZONE() 那样直接,但应该可以工作。