如何在 Oracle SQL Developer 中输入和显示小时和分钟的日期?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2411422/
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
How to key in and display date with hours and minutes into Oracle SQL Developer?
提问by Denis M. Kitchen
I'm using Oracle SQL Developer. I'd like to key in dates with hours and minutes, but the GUI doesn't appear to allow that. While I'm at it, it would be nice to display all date fields as 'YYYY-MM-DD HH24:MI:SS' within the Oracle SQL Developer GUI as well.
我正在使用 Oracle SQL Developer。我想输入带有小时和分钟的日期,但 GUI 似乎不允许这样做。在此期间,最好在 Oracle SQL Developer GUI 中将所有日期字段显示为“YYYY-MM-DD HH24:MI:SS”。
回答by Denis M. Kitchen
After some more poking around I found the right preference setting (screen shot below).
经过更多的探索,我找到了正确的偏好设置(下面的屏幕截图)。
Under "Tools -> Preference" there is a Database:NLS node you can configure. The setting I changed was "Date Format", which I changed to 'YYYY-MM-DD HH24:MI:SS'.
在“工具 -> 首选项”下有一个可以配置的 Database:NLS 节点。我更改的设置是“日期格式”,我将其更改为“YYYY-MM-DD HH24:MI:SS”。
I had to restart SQL Developer in order for these changes to take effect. After that, dates display as I want, and the input mask on the GUI also allowed me to edit time.
我必须重新启动 SQL Developer 才能使这些更改生效。之后,日期显示为我想要的,GUI 上的输入掩码也允许我编辑时间。
回答by Akashdeep Mandal
Or do this :
或者这样做:
alter session set nls_date_format = 'yyyy/mm/dd hh24:mi:ss';
更改会话集 nls_date_format = 'yyyy/mm/dd hh24:mi:ss';
Works too.
也有效。