Oracle date type to convert the timestamp type is date.

There are three ways to convert Oracle timestamp type is date.

1, to_char first into character, using to_date then converted to date type

select to_date(to_char(systimestamp,'yyyy/mm/dd hh24:mi:ss'),'yyyy/mm/dd hh24:mi:ss') from dual;

 

2, using implicit conversion SYSTIMESTAMP + 0

select systimestamp + 0 from dual; --oracle automatically implicit conversion

3, using the cast function to convert

select cast(systimestamp as date) from dual;
 

Guess you like

Origin www.cnblogs.com/xibuhaohao/p/11791000.html