我想将纪元时间转换为 pst 时区。 例如:1482440069 当我转换为 PST 时,我应该得到 2016-12-22
现在,当我尝试这个时,我得到了正确的答案
SELECT from_utc_timestamp('1970-01-01 07:00:00', 'PST');
此外,当我尝试这个时,我得到了正确的值
select from_unixtime(cast(1482440069 as bigint), 'yyyy-MM-dd')
o/p : 2016-12-22
但是,当我尝试这个查询时,我得到 NULL 响应
select from_utc_timestamp(from_unixtime(cast(1482440069 as bigint), 'yyyy-MM-dd'),'PST') -- Gives NULL response
最佳答案
使用 yyyy-MM-dd HH:mm:ss
而不是 yyyy-MM-dd
hive> select from_utc_timestamp(from_unixtime(cast(1482440069 as bigint), 'yyyy-MM-dd HH:mm:ss'),'PST');
OK
2016-12-22 04:54:29
关于hadoop - 在 hadoop/hive 中将纪元时间转换为 PST 区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42145767/