ORACLE数据库,Timestamp 的时间格式转换

1、字符型转成timestamp

select to_timestamp(loga006,'dd-MON-yyhh:mi:ss.ff AM')  from loga_t; 

 

 2、timestamp转成date型

select cast(to_timestamp(loga006,'dd-MON-yyhh:mi:ss.ff AM')as date) timestamp_to_date 

loga_t

 

3、date型转成timestamp

select cast(sysdateas timestamp) date_to_timestamp from loga_t

 

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

select systimestamp from loga_t

posted @ 2019-09-25 10:41  ww栗子  阅读(15943)  评论(0编辑  收藏  举报