0

How can I change 'YYYY-MON-DD HH24:MI:SS' to Date Format (Not String) mm/dd/yyyy?

Sample: 2012-01-20 12:04:13.287 to 01/20/2012

Mr John
  • 231
  • 1
  • 3
  • 18

1 Answers1

1

Dates (and timestamps) do not have a format - they are represented internally by 7 or 8 bytes for a date or 20 bytes for a timestamp.

If you want to format a date or a timestamp then you will have to convert it to a string either explicitly with TO_CHAR():

SELECT TO_CHAR( date_column, 'MM/DD/YYYY' )
FROM   your_table;

Or implicitly within whatever client program (i.e. you've tagged plsqldeveloper) you are using - in which case check the preferences within your IDE.

Community
  • 1
  • 1
MT0
  • 143,790
  • 11
  • 59
  • 117