【发布时间】:2020-02-12 00:05:16
【问题描述】:
我有一个以 MST 格式获取时区的查询。但是对于几行,它在 PT 中给出。
我使用的查询是 -
SELECT cca.last_update_date,
to_char(cast(cast(cca.last_update_date as timestamp with time zone) at time zone 'MST' as timestamp),'HH:MI:SS AM') mst_time
FROM CMP_CWB_AUDIT CCA
谁能帮我在sql查询中如何将时间格式更改为MST?
【问题讨论】:
-
列
last_update_date的数据类型是什么? -
时间戳@WernfriedDomscheit
-
这些值的时区是什么?
-
我不知道表中的当前时区。它可能会有所不同,但我希望输出具有 MST 时区
-
当数据类型为
TIMESTAMP(无时区)并且设计时不知道实际时区时,您无法将时区更改为 MST。 Oracle 没有内置水晶球。
标签: sql oracle plsql timezone datetime-format