236

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?

Rubens Mariuzzo
  • 28,358
  • 27
  • 121
  • 148
ComfortablyNumb
  • 3,391
  • 2
  • 14
  • 15
  • I've hard trouble with this before. I can correct it for a session, but once I close SQL Developer and then restart it again, I lose the setting. So this solution I can provide is not permanent. – Brett Walker Nov 15 '11 at 10:03
  • Can you add it an answer? @BrettWalker, it's better than nothing. – ComfortablyNumb Nov 15 '11 at 10:07
  • 5
    What a ridiculous default for a data type called "DATE" that actually stores precision to the second. This must have wasted a lot of people's time. – WW. Nov 19 '15 at 22:58

9 Answers9

455

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

Rubens Mariuzzo
  • 28,358
  • 27
  • 121
  • 148
ousoo
  • 4,584
  • 1
  • 15
  • 4
56

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' 
hipsandy
  • 982
  • 8
  • 7
39

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.

Donatello
  • 3,486
  • 3
  • 32
  • 38
8

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

Kapuśniak
  • 81
  • 1
  • 1
4

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 
Brett Walker
  • 3,566
  • 1
  • 18
  • 36
Jay Dorsey
  • 49
  • 2
  • It is important to note that the 'AM' format token is removed for the 24-hour format. If both the 'AM' and 'HH24' tokens are used, the 'AM' overrides the 'HH24'. – macawm May 27 '16 at 14:42
1

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.

0

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

Sharan Rajendran
  • 3,549
  • 2
  • 19
  • 6
0

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.

Brett Walker
  • 3,566
  • 1
  • 18
  • 36
-1

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!

alexR1
  • 11
  • 1
  • 2