Need to convert Timestamp(0) -- Functions?


(sivaraman gangadharan) #1

I am trying to get current timestamp loaded to the table in Teradata.

timestamp(0) in teradata is 1/31/2017 17:19:16

now() function in ataccama gives timestamp(3) 2017-01-31 16:24:31 .231.

i need to convert it to timestamp(0) by removing (.231) , any suggestions on function to do this ?

Thanks
Siva


(Said Abduraimov) #2

Hi Siva,

Please, try using the following expression:

tostring(now(), “YYYY-MM-dd HH:mm:ss”)

You should receive the output in the following format:
2017-02-01 08:28:05


(Said Abduraimov) #3

Siva,

If you would like to obtain the date in the specific format, which you have defined as timestamp(0), you should use the expression given below:

tostring(now(), “MM/dd/YYYY HH:mm:ss”)

The output will look as follows:
02/01/2017 08:42:06


(sivaraman gangadharan) #4

Thanks appreciate it .