Support Questions
Find answers, ask questions, and share your expertise

How can I convert PST time to UTC time in Hive?

Hello experts;

I have this query is getting PST time in Hive but how can I convert this PST time to UTC time? Please help

select from_unixtime(unix_timestamp()-1*60*60*4, 'yyyyMMddHH') as pst_time;

Thanks in advance

JN

1 ACCEPTED SOLUTION

Accepted Solutions

Guru

hi @JT Ng

Hive supports functions to_utc_timestamp() and from_utc_timestamp() to make this easier. Please see the language manual here for these functions including examples of how to invoke them.

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF

View solution in original post

2 REPLIES 2

Guru

hi @JT Ng

Hive supports functions to_utc_timestamp() and from_utc_timestamp() to make this easier. Please see the language manual here for these functions including examples of how to invoke them.

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF

View solution in original post

hi Sahi,

Thanks for your posts. I am able to use to_utc_timestamp() and from_utc_timestamp() functions.

Thanks