How can i convert a timestamp (formatted this way: 1,437,538,735.00) into date and time (such as 2016-11-23 14:00:00) in Teradata SQL?
Thank you!
How can i convert a timestamp (formatted this way: 1,437,538,735.00) into date and time (such as 2016-11-23 14:00:00) in Teradata SQL?
Thank you!
This looks like a Unix format for the time, so it is the number of seconds since 1970-01-01. Something like this should work:
select timestamp '1970-01-01 00:00:00' + interval '1437538735' second
I don't have Teradata on hand to specifically test the syntax.
Try this:
select CAST(DATE '1970-01-01' + (1437538735 / 86400) AS TIMESTAMP(0)) + ((1437538735 MOD 86400) * INTERVAL '00:00:01' HOUR TO SECOND) td_ts
select timestamp '1970-01-01 00:00:00' + 1437538735 * interval '0 00:00:01' day to second
P.s.
With this syntax you can use a colum/expression instead of the hard-coded value