Expected: to_unixtime(timestamp) , to_unixtime(timestamp with time zone)
(cast('2019-09-09 12:32:05' as timestamp)-cast('2019-09-08 12:32:05' as timestamp)
减出来是 1 xx:xx:xx as s
执行方法 to_unixtime(s)
出错。
解决方法:
to_unixtime((cast('2019-09-09 12:32:05' as timestamp))-to_unixtime(cast('2019-09-08 12:32:05' as timestamp))
转换成毫秒后就可以想变成啥变成啥。时分秒 任你选。怎么变时分秒,presto没有响应的方法, 你可以自己写prest function自定义函数,也可以写/60变成分,具体请查看 进制 之间的关系