Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Conversion using to_date(to_char(date field) )

470436May 7 2010 — edited May 10 2010
Dear Guru's

I have a table with Date Field . This stores only the Date and there is no time stored.

For a report i want the Date with time to be displayed. Since There is no time , the time to be displayed should be 12:00:00 along with the date

So i used To_char(SSDATE, 'DD-MON-YYYY HH:MI:SS') where ssdate is the name of the Date filed. This worked fine

I am using this in a function which returns a date . Hence i converted the above back to date like this

To_Date(To_Char(SSDATE,'DD-MON-YYYY HH:MI:SS'),'DD-MON-YYYY HH:MI:SS')

But the out put was like this 12/1/2001 12:00:00 PM. There is a PM appended to it which i dont need.

why this happens and how i can avoid the PM.

WIth Warm Regards
Ssr
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2010
Added on May 7 2010
8 comments
6,053 views