I\'m on presto and have a date formatted as varchar that looks like -
7/14/2015 8:22:39 AM
I\'ve looked the presto docs and tried various
You can also do something like this
date(cast('2016-03-22 15:19:34.0' as timestamp))
SQL 2003 standard defines the format as follows:
<unquoted timestamp string> ::= <unquoted date string> <space> <unquoted time string>
<date value> ::= <years value> <minus sign> <months value> <minus sign> <days value>
<time value> ::= <hours value> <colon> <minutes value> <colon> <seconds value>
There are some definitions in between that just link back to these, but in short YYYY-MM-DD HH:MM:SS
with optional .mmm
milliseconds is required to work on all SQL databases.