AWS Athena BIGINT with ddmmyyyyhhmmss to date time

djpraul 注册会员
2023-01-25 14:33

Amazon Athena is based on Presto, so you can use Date and Time Functions and Operators — Presto.

The date_parse() command can convert a string into a date by defining the format of the string (consult the above link to see the syntax).

Here is a solution, which first converts the number into a string (varchar) and then converts it into a date:

select date_parse(cast(10062019192751 as varchar),'%d%c%Y%k%i%s')

The output is:

2019-06-10 19:27:51.000

About the Author

Question Info

Publish Time
2023-01-25 14:33
Update Time
2023-01-25 14:33