如何将epoch时间戳转换为hive中的PST日期

问题描述:

我有一个具有epoch时间戳的表列我想在PST时间将该列转换为日期。如何将epoch时间戳转换为hive中的PST日期

select epoch_time from table;例如

input 
    epoch_time 
    1262304151988 
    1262304157756 

输出

epoch_time 
    YYY-MM_DD 
    YYY-MM_DD 

在PST

+0

给出一个完整的例子,包括预期的结果 - 实际数据,你想看到它。 –

select to_utc_timestamp(1262304151988,'PST'); 

2010-01-01○时02分31秒

select to_utc_timestamp(1262304157756,'PST'); 

2010-01-01 0时02分37秒

+0

添加'to_date()'将时间戳转换为日期,如期望的输出 – leftjoin