SQL oracle pl/sql开发者如何查看时区

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37528652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 04:37:59  来源:igfitidea点击:

How to check the timezone of oracle pl/sql developer

sqloracleplsqlplsqldeveloper

提问by sith

Where do I check the timezone of oracle pl/sql developer.Can someone help please

我在哪里检查oracle pl/sql developer的时区。有人可以帮忙吗

回答by mathguy

I just ran select systimestamp from dual;in SQL developer on my machine, it replied with 30-MAY-16 12.49.28.279000000 PM -05:00. The -05:00 shows the timezone offset (5 hours behind UTC, essentially 5 hours behind GMT with no daylight savings time adjustments made to GMT). This shows the database server time zone.

我刚刚select systimestamp from dual;在我的机器上运行SQL developer,它回复了30-MAY-16 12.49.28.279000000 PM -05:00. -05:00 显示时区偏移量(比 UTC 晚 5 小时,基本上比 GMT 晚 5 小时,没有对 GMT 进行夏令时调整)。这显示了数据库服务器时区。

Then I ran select current_timestamp from dual;and I got: 30-MAY-16 12.54.17.762000000 PM AMERICA/CHICAGOwhich in fact is the same timezone (but in different format - it depends on the settings I have). I get the same result because my "server" is on my personal laptop, which is also the "client". In the general case, the timezone component from this query will be the "local" or "client" or "session" timezone, while the first query (with systimestamp) gives the "server" or "database" timezone.

然后我跑了select current_timestamp from dual;,我得到:30-MAY-16 12.54.17.762000000 PM AMERICA/CHICAGO实际上是同一个时区(但格式不同 - 这取决于我的设置)。我得到相同的结果,因为我的“服务器”在我的个人笔记本电脑上,它也是“客户端”。在一般情况下,此查询的时区组件将是“本地”或“客户端”或“会话”时区,而第一个查询(使用 systimestamp)给出“服务器”或“数据库”时区。

回答by djva

TIMESTAMP WITH LOCAL TIME ZONE does not store time zone information internally, but you can see local time zone information in SQL output if the TZH:TZM or TZR TZD format elements are specified.

TIMESTAMP WITH LOCAL TIME ZONE 不会在内部存储时区信息,但如果指定了 TZH:TZM 或 TZR TZD 格式元素,您可以在 SQL 输出中看到本地时区信息。

Try this:

尝试这个:

select TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') from dual