迄今为止的Amazon Athena Covert字符串 [英] Amazon Athena Covert String to Date

查看:69
本文介绍了迄今为止的Amazon Athena Covert字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将以下字符串: mmm-dd-yyyy 转换为日期: yyyy-mm-dd

I am looking to convert the following string: mmm-dd-yyyy to a date: yyyy-mm-dd

eg

2015年11月6日至2015-11-06

在Amazon Athena内

within Amazon Athena

推荐答案

我会做date_parse。相应地调整您的正则表达式。

I would do date_parse. Adjust your regex accordingly.

选择date_parse('Nov-06-2015','%b-%d-%Y')

select date_parse('Nov-06-2015','%b-%d-%Y')

2015-11-06 00:00:00.000

2015-11-06 00:00:00.000

refd: https://prestodb.io/docs/current/functions/datetime.html

这篇关于迄今为止的Amazon Athena Covert字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆