【发布时间】:2017-11-16 05:13:12
【问题描述】:
我有输入值
161223000001
我需要转换成
2016-12-23 00:00:01
我试过了
select cast(161223000001 as timestamp)
7078-12-14 22:40:01
我得到的答案不正确
【问题讨论】:
标签: impala
我有输入值
161223000001
我需要转换成
2016-12-23 00:00:01
我试过了
select cast(161223000001 as timestamp)
7078-12-14 22:40:01
我得到的答案不正确
【问题讨论】:
标签: impala
您可以在 Impala 中使用to_timestamp 函数将字符串转换为时间戳
SELECT to_timestamp('161223000001', 'yyMMddHHmmss');
通过在您最初的尝试中使用 CAST AS TIMESTAMP,它会将给定的字符串识别为 unix 纪元时间
【讨论】: