如何在 Oracle SQL Developer 中设置自定义日期时间格式?
默认情况下,Oracle SQL Developer 将日期值显示为 15-NOV-11
。我想默认看到时间部分(小时/分钟/秒)。
有没有办法在 Oracle SQL Developer 中配置它?
By default, Oracle SQL developer displays date values as 15-NOV-11
. I would like to see the time part (hour/minute/second) by default.
Is there a way to configure this within Oracle SQL Developer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
您可以在首选项中更改此设置:
DD-MON-RR HH24:MI:SS
。以下是屏幕截图:
You can change this in preferences:
DD-MON-RR HH24:MI:SS
into the Date Format field.Here is a screenshot:
我在尝试更改 sql-developer 中日期的显示格式时偶然发现了这篇文章。只是想添加我发现的内容:
但很多时候,我只想保留 DEFAULT_FORMAT,同时仅在一堆相关查询期间修改格式。那时我将使用以下内容更改会话的格式:
alter SESSION set NLS_DATE_FORMAT = 'my_required_date_format'
例如:
I stumbled on this post while trying to change the display format for dates in sql-developer. Just wanted to add to this what I found out:
But a lot of times, I just want to retain the DEFAULT_FORMAT while modifying the format only during a bunch of related queries. That's when I would change the format of the session with the following:
alter SESSION set NLS_DATE_FORMAT = 'my_required_date_format'
Eg:
使用 Oracle SQL Developer 3.2.20.09,我设法以这种方式设置 DATE 类型的自定义格式:
在:工具 >首选项>数据库> NLS
或:Outils >偏好 >受赠人的基础>非线性LS
请注意,以下格式不起作用
结果保持默认格式,没有任何错误。
With Oracle SQL Developer 3.2.20.09, i managed to set the custom format for the type DATE this way :
In : Tools > Preferences > Database > NLS
Or : Outils > Préférences > Base de donées > NLS
Note that the following format does not worked for me :
As a result, it keeps the default format, without any error.
就我而言,在 Preferences/Database/NLS 中设置的格式
[日期格式] = RRRR-MM-DD HH24:MI:SSXFF
但在网格中看到8可能是默认格式RRRR/MM/DD(即使没有时间)
将设置[日期格式]更改为后格式已更改:
RRRR-MM-DD HH24:MI:SS
(末尾没有“XFF”)。
没有错误,但是末尾带有 xff 的格式不起作用。
注意:在波兰语中,RRRR 表示 YYYY
In my case the format set in Preferences/Database/NLS
was [Date Format] = RRRR-MM-DD HH24:MI:SSXFF
but in grid there were seen 8probably default format RRRR/MM/DD (even without time)
The format has changed after changing the setting [Date Format] to:
RRRR-MM-DD HH24:MI:SS
(without 'XFF' at the end).
There were no errors, but format with xff at the end didn't work.
Note: in polish notation RRRR means YYYY
对于仍然对此有疑问的人;我碰巧从 Google 找到了这个页面...
像这样放入(NLS 参数)...它在 SQLDeveloper v3.0.04 中对我来说很重要:
For anyone still having an issue with this; I happened to find this page from Google...
Put it in like this (NLS Parameters)... it sticks for me in SQLDeveloper v3.0.04:
SQL Developer 版本 4.1.0.19
第 1 步:转到工具 ->首选项
第2步:选择数据库-> NLS
步骤 3:转到“日期格式”并输入 DD-MON-RR HH24:MI:SS
步骤 4:单击“确定”。
SQL Developer Version 4.1.0.19
Step 1: Go to Tools -> Preferences
Step 2: Select Database -> NLS
Step 3: Go to Date Format and Enter DD-MON-RR HH24: MI: SS
Step 4: Click OK.
当我复制时间戳的日期格式并将其用于日期时,它不起作用。但是将日期格式更改为此(DD-MON-YY HH12:MI:SS AM)对我有用。
必须在“工具”->“首选项”->“选项”中进行更改。搜索 NLS
When i copied the date format for timestamp and used that for date, it did not work. But changing the date format to this (DD-MON-YY HH12:MI:SS AM) worked for me.
The change has to be made in Tools->Preferences-> search for NLS
我有一个相关的问题已解决,并想让人们了解我的解决方案。我使用 SQL Developer 从一个数据库导出到 csv,然后尝试将其导入到另一个数据库中。我的日期字段不断出现错误。我的日期字段采用时间戳格式:
导入时上述解决方案(更改 NLS 首选项)对我不起作用,但我最终得到了以下结果:
在“导入向导列定义”屏幕中,我输入“
在格式框中输入DD-MON-RR HH.MI.SSXFF AM
”,终于导入成功了。不幸的是,我有几十个日期字段,据我所知,没有办法系统地将此格式应用于所有日期字段,所以我不得不手动执行......叹息。如果有人知道更好的方法,我很乐意听到!I have a related issue which I solved and wanted to let folks know about my solution. Using SQL Developer I exported from one database to csv, then tried to import it into another database. I kept getting an error in my date fields. My date fields were in the Timestamp format:
The above solution (changing the NLS preferences) did not work for me when I imported, but I finally got the following to work:
In the Import Wizard Column Definition screen, I entered "
DD-MON-RR HH.MI.SSXFF AM
" in the Format box, and it finally imported successfully. Unfortunately I have dozens of date fields and to my knowledge there is no way to systematically apply this format to all date fields so I had to do it manually....sigh. If anyone knows a better way I'd be happy to hear it!转到工具>偏好。在树中,选择数据库 >国家LS。提供三种日期/时间格式:日期、时间戳和时间戳 TZ。编辑日期格式可达到所需的效果。
正如我上面所说;这种方法并没有给我带来永久性的改变。
Goto to Tools > Preferences. In the tree, select Database > NLS. There are three Date/Time formats available: Date, Timestamp and Timestamp TZ. Editing the Date format gives the desired effect.
Like I have said above; this approach has not given me a permanent change.