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!

Date Format Issue - AM/PM

OBIEE_DroolMay 24 2016 — edited May 25 2016

Hello,

Can someone please stop me from going mad? I am unable to convert this date format to correct value:

1. Why is it displaying AM despite data is PM?

select to_timestamp_tz(substr('30-MAR-16 02.48.52.629000000 PM AMERICA/CHICAGO',0,20),'DD/MM/YY HH24:MI:SS TZH:TZM')  as date_inserted from dual;

----------------------------------------------------------

30-MAR-16 02.48.52.000000000 AM +06:00

select NEW_TIME ((to_timestamp_tz(substr('30-MAR-16 02.48.52.629000000 PM AMERICA/CHICAGO',0,18),'DD/MM/YY HH24:MI:SS')), 'GMT', 'CDT')  as date_inserted from dual;
-----------------------------------------------------------

3/30/16 2:48 AM

Please advise.

This post has been answered by Vysakh Suresh - 3035408 on May 25 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2016
Added on May 24 2016
14 comments
3,343 views