In Oracle, a DATE
is a binary data-type that consists of 7 bytes representing century, year-of-century, month, day, hour, minute and second. It ALWAYS has these components and it is NEVER stored in any particular human readable format.
You CANNOT change how dates are stored.
If you want to see the binary representation of the date values then use:
SELECT DUMP(date_column) FROM table_name;
What you are seeing is how the client application (i.e. the program that you use to query the database) choses to display that binary information to you.
Some client applications (i.e. mainly those written by Oracle including SQL*Plus, SQL Developer and SQLcl) will set their default display format according to the NLS_DATE_FORMAT
session parameter.
However, that is specific to those client applications. Internally, the database uses the NLS_DATE_FORMAT
as the format model when implicitly casting from strings to dates and vice-versa. When a client application asks for a DATE
data-type then the database sends the unformatted binary representation of the date and lets the client application handle how that is formatted.
Other client applications will have their own internal configuration and will use that to format dates when displaying them.
If you want to format a date in a specific way then:
- Retrieve (unformatted)
DATE
data-types from the database and allow the client application to format it according to it's configuration (and, if required, update the settings of every client application); or
- Don't display an (unformatted)
DATE
data-type and use TO_CHAR
(or other functions) to format the date into a specific format.