Quantcast
Viewing all articles
Browse latest Browse all 100

Converting Unix/EPOCH time to PST - forum topic by manish237

I have a column in my teradata table which stores timestamp in UNIX/EPOCH form. I want to run a query and get the corresponding Date in PST and number of records against that date. I got the following query to convert the EPOCH time to Date, but not able to figure out how to get the corresponding PST date.
 
SELECT CAST (CAST(DATE '1970-01-01' + (CAST (TIME_CREATED AS INTEGER)/86400 ) AS TIMESTAMP(0) ) + ((CAST (TIME_CREATED AS INTEGER) MOD 86400 ) * INTERVAL '00:00:01' HOUR TO SECOND) AS DATE), COUNT(ID) FROM MY_TABLE GROUP BY 1

Forums: 

Viewing all articles
Browse latest Browse all 100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>