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!

timestamp format conversion

user8521080Apr 27 2020 — edited Apr 27 2020

Hello,

select TO_TIMESTAMP(to_date('2020-03-25T15:19:50Z','yyyy-mm-dd"T"hh24:mi:ss"Z"') +1/24/60) ABC_time from dual;

I am trying this but it gives me default time 12 AM - 25-MAR-20 12.00.00.000000000 AM

How can i make the above time work in this format -25-MAR-20 15.19.50.000000000 PM

2nd case- in this approach i am not getting ms

to_char(to_timestamp(old_ts , 'YYYY-MM-DD"T"HH24:MI:SS"Z"') + 1/24/60, 'DD-MON-YYYY HH24:MI:SS AM')  AS ABC_time

old_ts is in varchar

Comments
Post Details
Added on Apr 27 2020
2 comments
2,785 views