I searched a lot on Internet but couldn't find the answer. Here is my question:
I'm writing some queries in Hive. I have a UTC timestamp and would like to change it to UTC time, e.g., given timestamp 1349049600, I would like to convert it to UTC time which is 2012-10-01 00:00:00. However if I use the built in function from_unixtime(1349049600)
in Hive, I get the local PDT time 2012-09-30 17:00:00.
I realized there is a built in function called from_utc_timestamp(timestamp, string timezone)
. Then I tried it like from_utc_timestamp(1349049600, "GMT")
, the output is 1970-01-16 06:44:09.6 which is totally incorrect.
I don't want to change the time zone of Hive permanently because there are other users. So is there any way I can get a UTC timestamp string from 1349049600 to "2012-10-01 00:00:00"? Thanks a lot!!