如何在 Oracle SQL Developer 中设置自定义日期时间格式?

发布于 2024-12-15 17:53:18 字数 127 浏览 2 评论 0原文

默认情况下,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

耶耶耶 2024-12-22 17:53:18

您可以在首选项中更改此设置:

  1. 从 Oracle SQL Developer 的菜单转到:工具 > 偏好
  2. 首选项对话框中,选择数据库> NLS 来自左侧面板。
  3. 从 NLS 参数列表中,在“日期格式”字段中输入 DD-MON-RR HH24:MI:SS
  4. 保存并关闭对话框,完成!

以下是屏幕截图:

在 Oracle SQL Developer 中更改日期格式首选项

You can change this in preferences:

  1. From Oracle SQL Developer's menu go to: Tools > Preferences.
  2. From the Preferences dialog, select Database > NLS from the left panel.
  3. From the list of NLS parameters, enter DD-MON-RR HH24:MI:SS into the Date Format field.
  4. Save and close the dialog, done!

Here is a screenshot:

Changing Date Format preferences in Oracle SQL Developer

少女七分熟 2024-12-22 17:53:18

我在尝试更改 sql-developer 中日期的显示格式时偶然发现了这篇文章。只是想添加我发现的内容:

  • 要更改默认显示格式,我将使用 ousoo 提供的步骤,即“工具”>“首选项> ...
  • 但很多时候,我只想保留 DEFAULT_FORMAT,同时仅在一堆相关查询期间修改格式。那时我将使用以下内容更改会话的格式:

    alter SESSION set NLS_DATE_FORMAT = 'my_required_date_format'

例如:

   alter SESSION set NLS_DATE_FORMAT = 'DD-MM-YYYY HH24:MI:SS' 

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:

  • To Change the default display format, I would use the steps provided by ousoo i.e Tools > Preferences > ...
  • 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:

   alter SESSION set NLS_DATE_FORMAT = 'DD-MM-YYYY HH24:MI:SS' 
追风人 2024-12-22 17:53:18

使用 Oracle SQL Developer 3.2.20.09,我设法以这种方式设置 DATE 类型的自定义格式:

在:工具 >首选项>数据库> NLS

或:Outils >偏好 >受赠人的基础>非线性LS

YYYY-MM-DD HH24:MI:SS

设置菜单屏幕截图

请注意,以下格式不起作用

DD-MON-RR HH24:MI:SS

结果保持默认格式,没有任何错误。

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

YYYY-MM-DD HH24:MI:SS

Settings Menu screenshot

Note that the following format does not worked for me :

DD-MON-RR HH24:MI:SS

As a result, it keeps the default format, without any error.

野却迷人 2024-12-22 17:53:18

就我而言,在 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

等数载,海棠开 2024-12-22 17:53:18

对于仍然对此有疑问的人;我碰巧从 Google 找到了这个页面...

像这样放入(NLS 参数)...它在 SQLDeveloper v3.0.04 中对我来说很重要:

DD-MON-YY HH12:MI:SS AM or for 24-Hour, DD-MON-YY HH24:MI:SS 

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:

DD-MON-YY HH12:MI:SS AM or for 24-Hour, DD-MON-YY HH24:MI:SS 
娇柔作态 2024-12-22 17:53:18

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.

戒ㄋ 2024-12-22 17:53:18

当我复制时间戳的日期格式并将其用于日期时,它不起作用。但是将日期格式更改为此(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

留一抹残留的笑 2024-12-22 17:53:18

我有一个相关的问题已解决,并想让人们了解我的解决方案。我使用 SQL Developer 从一个数据库导出到 csv,然后尝试将其导入到另一个数据库中。我的日期字段不断出现错误。我的日期字段采用时间戳格式:

28-JAN-11 03.25.11.000000000 PM

导入时上述解决方案(更改 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:

28-JAN-11 03.25.11.000000000 PM

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!

淡淡の花香 2024-12-22 17:53:18

转到工具>偏好。在树中,选择数据库 >国家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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文