Convert text to a timestamp

Database

Convert text to a timestamp

Hi All,

I am trying to replicate the below vertica conversion to timestamp to teradata, But I am getting error. Can someone please guide me?

Vertica:

to_timestamp('June 7, 2016, Hour 0','Month DD, YYYY, Hour HH') 

--output:

'2016-06-07 00:00:00'

Tags (2)
3 REPLIES

Re: Convert text to a timestamp

CAST(CAST(TO_TIMESTAMP(OREPLACE('June 07,2016,HOUR 1','HOUR',''),'MONTH dd,yyyy,HH24') AS VARCHAR(19)) AS TIMESTAMP(0))

Re: Convert text to a timestamp

Hi All I am trying to convert

 2016-08-03 8:32:03

2016-08-03 11:56:34 

which are in varchar to timestamp. can you please help me

N/A

Re: Convert text to a timestamp

sel to_timestamp('june 7,2016,12' ,'Month DD,YYYY,HH')

Try This It worked for me