1、字符型转成timestamp
select to_timestamp('01-10月-15 07.46.41.000000000 上午','dd-MON-yy hh:mi:ss.ff AM') from dual;2、timestamp转成date型
select cast(to_timestamp('01-10月-15 07.46.41.000000000 上午','dd-MON-yy hh:mi:ss.ff AM') as date) timestamp_to_date from dual;3、date型转成timestamp
select cast(sysdate as timestamp) date_to_timestamp from dual;
4、获取timestamp格式的系统时间
select systimestamp from dual;
5、两date的日期相减得出的是天数,而两timestamp的日期相减得出的是完整的年月日时分秒小数秒
select systimestamp-systimestamp from dual; select sysdate-sysdate from dual;
注:timestamp要算出两日期间隔了多少秒,要用函数转换一下。