I have unix epcoh timestamp with timezone and it needs to be converted to teradata timestamp(6). I have tried to solve this by seeing old posts in teradata forums, but none of them are related to timezone. One of the example in the sample is 1466017810720. Kindly help.
Below code worked for me.
A Unix epoch doesn't hava a timezone, it's based on UTC.
Your timestamp simply includes milliseconds, your caluclation can be simplyfied to:
-- assuming your epoch column is a BIGINT, otherwise you have to use
-- (TO_TIMESTAMP(CAST(epoch AS BIGINT) / 1000) AT 0)
(TO_TIMESTAMP(epoch / 1000) AT 0)
+ ( epoch MOD 1000 * INTERVAL '0.001' SECOND ) AS gmt_time