presto字符串转日期

方法1

date_parse(string, format) → timestamp
Parses string into a timestamp using format.
> select date_parse('2020-12-05','%Y-%m-%d');
          _col0
-------------------------
 2020-12-05 00:00:00.000

方法2:

> select (cast ('2020-12-05' as date));
   _col0
------------
 2020-12-05

版权声明:本文为u010711495原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。