hi

t as TO_TIMESTAMP(FROM_UNIXTIME(ts/1000,'yyyy-MM-dd HH:mm:ss')) 这样设置就可以了. 
Best
JasonLee
 
发件人: zilong xiao
发送时间: 2020-06-30 16:29
收件人: user-zh
主题: flink SQL如何将秒转换为timestamp
有一个字段itime,类型为int,意为当前时间的秒值,如何将该字段转换成timestamp?以下是我的想法,不知是否正确,求遇到过类似问题的大佬指导
 
TO_TIMESTAMP(DATE_FORMAT(CAST(itime * 1000 as TIMESTAMP(3)), 'yyyy-MM-dd
hh:mm:ss'))

回复