Skip to content
Advertisement

Convert string date format MM/dd/yyyy HH:mm:ss.SSSS to timestamp presto

I have a string that looks like:

I am trying to convert this to a timestamp as follows:

but i keep getting an error:

Advertisement

Answer

The value in your example matches the format of timestamp literals in SQL, so you can convert it to a timestamp type by just casting the value to the desired type:

Advertisement