Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Changing the default date to DD-MM-YYYY
Changing the default date to DD-MM-YYYY [message #600395] Wed, 06 November 2013 00:53 Go to next message
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 Go to previous messageGo to next message
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 use
select 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.
Re: Changing the default date to DD-MM-YYYY [message #600404 is a reply to message #600398] Wed, 06 November 2013 02:03 Go to previous messageGo to next message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
well, thanks. I worked, but another problem came up.
I made a form for my table, but when inserting a date, it doesn't insert a date of my format, it asks me to insert it as DD-MON-YYYY
Re: Changing the default date to DD-MM-YYYY [message #600405 is a reply to message #600404] Wed, 06 November 2013 02:04 Go to previous messageGo to next message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
any idea how to fix it >?
Re: Changing the default date to DD-MM-YYYY [message #600406 is a reply to message #600405] Wed, 06 November 2013 02:09 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Display that item as a "Date picker" and set its format mask (under the Settings section).
Re: Changing the default date to DD-MM-YYYY [message #600407 is a reply to message #600406] Wed, 06 November 2013 02:12 Go to previous message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
Thanks
Previous Topic: Tabular Form created on a View is not Updating
Next Topic: A problem with a function
Goto Forum:
  


Current Time: Wed Dec 04 12:54:34 CST 2024