user2846737
user2846737

Reputation: 211

how to convert a number into timestamp in oracle/sql

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

Answers (1)

Thorsten Kettner
Thorsten Kettner

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

Related Questions