I have data in S3 bucket which can be fetched using Athena query. The query and output of data looks like this

 

The Datetime data is timestamp with timezone offset info. If you want to run query to filter data between 2 dates then you have to format the string data into from_iso8601_timestamp format and then type cast using date function.

>> Convert to timestamp formatĀ 

Query will be like –

Output of query:

>> Convert to date format

Query will be like –

Output of query:

>>Filter data between two dates

Query will be like –

Output of query:

Another query like this-

Output of query: