You said that you wanted to get the "PST date", but time zones are not associated with DATE values. In other words, the Teradata Database does not offer a DATE WITH TIME ZONE data type.
Your outermost CAST must cast to TIMESTAMP rather than cast to DATE. With the CAST to TIMESTAMP, then you can use the AT 'America Pacific' clause to convert the TIMESTAMP to your desired time zone.
Here is the modified query:
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 TIMESTAMP) AT 'America Pacific', COUNT(ID) FROM MY_TABLE GROUP BY 1
You said that you wanted to get the "PST date", but time zones are not associated with DATE values. In other words, the Teradata Database does not offer a DATE WITH TIME ZONE data type.
Your outermost CAST must cast to TIMESTAMP rather than cast to DATE. With the CAST to TIMESTAMP, then you can use the AT 'America Pacific' clause to convert the TIMESTAMP to your desired time zone.
Here is the modified query:
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 TIMESTAMP) AT 'America Pacific', COUNT(ID) FROM MY_TABLE GROUP BY 1