Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

avatar
Rising Star

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

avatar
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

avatar
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

avatar
Rising Star

hi Sahi,

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

Thanks