Home » SQL & PL/SQL » SQL & PL/SQL » problem with to_date function format..
problem with to_date function format.. [message #238703] Sat, 19 May 2007 08:12 Go to next message
pavanoracle
Messages: 1
Registered: May 2007
Junior Member
Hi,

I am inserting date in my table and give 24hr format but data inserted only in 12 hour format. i m giving query , it's running and data instered properly but i need to insert date in 24 hr format.

I M USING ORACLE 9I...


INSERT INTO MYTABLE (ID,TITLE,INSERTED_DATE) VALUES ID_SEQ.nextval,'tiger',TO_DATE('05/19/2007 13:00:03','MM/DD/YYYY HH24:MI:SS'))

after executing this query in oracle i got : 5/19/2007 1:00:03 PM

is it ok. i think oracle internally converting it that indicate i can not store 24 hr format like that : 05/19/2007 13:00:03

Thanks,


Re: problem with to_date function format.. [message #238707 is a reply to message #238703] Sat, 19 May 2007 08:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle internally store what you gave.
You gave a correct date, so it store a correct date.
So this how you retrieve it, that is wrong.

Post how you retrieve.
I bet you just select without giving a format and your default format is 'MM/DD/YYYY HH:MI:SS AM'.

Regards
Michel
Re: problem with to_date function format.. [message #238708 is a reply to message #238703] Sat, 19 May 2007 08:53 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Oracle stores dates without any formatting. The formatting happens when you select from your table, so you probably have a select with a 12 hr PM time format.
Previous Topic: Can this be achieved without using EXISTS
Next Topic: PRAGMA INTERFACE
Goto Forum:
  


Current Time: Thu Dec 08 08:50:42 CST 2016

Total time taken to generate the page: 0.08163 seconds