Reputation: 211
how to convert a number into timestamp(6) in oracle? ie convert 20131108 to 08-NOV-13 12.00.00.000000 AM or any format in timestamp(6). Thanks!
Upvotes: 2
Views: 25536
Reputation: 94859
You convert your number to a string with to_char. Then you convert that string to timestamp with to_timestamp. Time will automatically be midnight.
select to_timestamp( to_char(20131108) ,'yyyymmdd') from dual
Upvotes: 5