2017-02-09 4 views
1

epoch 시간을 pst time zone으로 변환하고 싶습니다. 예를 들어 : 나는 PST로 변환 할 때 1482440069, 나는이 때 나는이 때, 나는 적절한 얻을hadoop/hive에서 epoch time을 PST zone으로 변환

SELECT from_utc_timestamp('1970-01-01 07:00:00', 'PST'); 

또한 적절한 답변을 얻을 지금 2016년 12월 22일

을 얻어야한다 값

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 

답변

0

사용 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 
0

SE LECT from_utc_timestamp (cast_from_unixtime ('1970-01-01 07:00:00', 'yyyy-MM-dd HH : mm : ss') bigint) + (time_zone 값은 -5 또는 -6 * 3600과 같습니다. ;