oracle日期时间型timestamp的深入理解

来源:互联网 发布:淘宝达人帖子要求 编辑:程序博客网 时间:2024/05/16 15:33

1、字符型转成timestamp

select to_timestamp('01-10月-08 07.46.41.000000000 上午','dd-MON-yy hh:mi:ss.ff AM')  from dual;  

2、timestamp转成date型

select cast(to_timestamp('01-10月-08 07.46.41.000000000 上午','dd-MON-yy hh:mi:ss.ff AM') as date) timestamp_to_datefrom dual; 

3、date型转成timestamp

select cast(sysdate as timestamp) date_to_timestamp  from dual;  

4、获取timestamp格式的系统时间

select systimestamp from dual;