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!

to_char on an Oracle date

635718Mar 26 2012 — edited Mar 26 2012
I'm trying to use:
TO_CHAR(a.some_dt, 'FMMM/DD/YYYY HH:MM:SS AM') AS some_dt_str,
but it's not giving desired output.
Is there a to_char(date, '+something+') that can accomplish these desired outputs:

11/23/2011 5:44:01 AM
2/8/2012 6:48:29 AM
2/8/2012 6:02:45 PM

Notice it's not 02/08/2012

?

The aforementioned 'FMMM/DD/YYYY HH:MM:SS AM' is close, I think, but I've seen output like:
3/26/2012 2:3:14 AM

and that 2:3 is not desired. It should be 2:03:14 AM ...

thank you for help.
This post has been answered by sb92075 on Mar 26 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2012
Added on Mar 26 2012
3 comments
1,778 views