Technology · Uncategorized

SQL Developer – Date Format


You are on SQL Developer and have a date-time column, you run a query and it only displays the date. You could do a “to_char(mydatefield,’MM/DD/YYYY hh24:mi:ss’) ” but then you will have to do it for ALL date fields and change all your saved queries.

You wish there was something in SQL-Developer that would apply this globally. Well there is, goto Tools->Preferences -> NLS

Now you have to set the Date Format on the right ….so what is it? “DD-MON-RR”  or “DD-MON-RRRR” or  “DD-MON-RR HH24.MI.SSXFF AM” or something more obscure to display your dates with times on them?

It turns out,  you can use anything as long as you specify the right time format “DD-MON-RR HH.MI.SSXFF AM” or “DD-MON-RR HH.MI.SS AM” or “MM/DD/RRRR HH.MI.SS AM” as shown above.

Advertisements

4 thoughts on “SQL Developer – Date Format

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s