Changing the default date to DD-MM-YYYY [message #600395] |
Wed, 06 November 2013 00:53 |
|
amjad_alahdal
Messages: 102 Registered: October 2013 Location: Saudi Arabia
|
Senior Member |
|
|
Hello every one,
I have export a database from access to Oracle. One of the columns is a date type. In the access, the date was written in this way, 01/01/1989 which refers to 01-JAN-1989. Well, I don't want that form in the dates, I tried to alter the type of the column and change it to DD-MM-YYYY. It never works.
Thanks
|
|
|
Re: Changing the default date to DD-MM-YYYY [message #600398 is a reply to message #600395] |
Wed, 06 November 2013 01:19 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
DATE datatype has no format at all, it is not readable by us, humans. Therefore, Oracle provided options to see it the way we are used to. In order to do that, we use TO_CHAR function with the appropriate date format mask. It means that you'd useselect to_char(your_date_column, 'dd-mm-yyyy') from your_table
Or, you can "alter session" and set date format as (this is SQL*Plus example; other tools might have a different way to do that):SQL> select sysdate from dual;
SYSDATE
-------------------
06.11.2013 08:12:43
SQL> alter session set nls_date_format = 'dd-mm-yyyy';
Session altered.
SQL> select sysdate from dual;
SYSDATE
----------
06-11-2013
SQL> DBA can set it at the whole database level - ask him/her to do that (the request might be revoked, though).
In Application Express (as you put the question here), date format is set here: Shared components - Globalization section - Globalization attributes - Application date (time) format.
|
|
|
|
|
|
|