Krishnamatta
Contributor

 

Convert to timestamp first and then format to string

select  date_format(to_timestamp('Dec 17 2016 8:22PM', 'MMM dd yyyy h:ma'), "yyyy-MM-dd HH:mm:ss")

Here is the documentation for this:

https://docs.databricks.com/en/sql/language-manual/sql-ref-datetime-pattern.html

View solution in original post