1、date()函数、time()函数、timestamp()函数
select date(trim(char('2009-09-01 '))),time(trim(char('12:23:34 '))),timestamp(trim(char('2009-02-26-14.28.40.234000')))
from sysibm.dual
2、char()函数
select char(current date),char(current time),char(current timestamp) from sysibm.dual
3、to_char()函数
select to_char(current timestamp,'yyyy-mm-dd hh24:mi:ss') from sysibm.dual
范例三:将timestamp类型转换字符串类型,运用to_char函数
EBB925字段是timestamp类型
select * from ori_mv_ebb39 where to_char(EBB925, 'yyyy-mm-dd hh24:mi:ss') >= '2019-09-01 00:00:00'
TO_CHAR是转化函数
YYYY-MM-DD HH24:MI:SS 是格式
4、to_date()函数
select to_date('2009-01-01 12:23:45','yyyy-mm-dd hh24:mi:ss') from sysibm.dual