Integer to Timestamp

Database
Fan

Integer to Timestamp

How can I convert an integer value, that means seconds to timestamp value?

2 REPLIES
Teradata Employee

Re: Integer to Timestamp

You need as well a date as starting ponint for example '1901-01-01'

select CAST(DATE '1901-01-01' AS TIMESTAMP(0))+((cast(12 as bigint) MOD 86400) * INTERVAL '00:00:01.000' HOUR TO SECOND)
Junior Contributor

Re: Integer to Timestamp

You can also utilize TO_TIMESTAMP(1460961231)