plsql - Removing the millisecond from the timestamp -


i need convert timestamp date in pl sql. input '2016-08-01t09:16:47.000' webservice, require '8/01/2016 9:16:47 am'. i take input varchar2.

it can "am" or "pm".

i tried using select trunc(to_timestamp('2016-08-01t09:16:47.000','yyyy-mm-dd"t"hh24:mi:ss.ff3')) dual; time part removed.

select to_char(to_timestamp('08/01/2016 09:16:47.000000000 am', 'mm/dd/yyyy hh:mi:ss.ff am'),'mm/dd/yyyy hh:mi:ss am') dual; 

edit: works or pm

select to_char(to_timestamp('08/01/2016 09:16:47.000000000 pm', 'mm/dd/yyyy hh:mi:ss.ff am'),'mm/dd/yyyy hh:mi:ss am') dual; 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -