Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Athena Convert String to Date

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

e.g

Nov-06-2015 to 2015-11-06

within Amazon Athena

like image 889
Data_101 Avatar asked Jan 08 '18 14:01

Data_101


1 Answers

I would do date_parse. Adjust your regex accordingly.

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

2015-11-06 00:00:00.000

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

like image 190
Blu3 Avatar answered Oct 13 '22 01:10

Blu3