Presto SQL - Converting a date string to date format

后端 未结 8 1649
谎友^
谎友^ 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:32

    I figured it out. The below works in converting it to a 24 hr date format.

    select date_parse('7/22/2016 6:05:04 PM','%m/%d/%Y %h:%i:%s %p')
    

    See date_parse documentation in Presto.

提交回复
热议问题