Presto SQL - Converting a date string to date format

后端 未结 8 1654
谎友^
谎友^ 2020-12-14 14:58

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

8条回答
  •  一向
    一向 (楼主)
    2020-12-14 15:47

    SQL 2003 standard defines the format as follows:

     ::=   
     ::=     
    

    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.

提交回复
热议问题