I want to get the last modified file from an Amazon S3 directory.
I tried to only print that file's date only now, but I am getting the error:

> 
> TypeError: 'datetime.datetime' object is not iterable
> 
> 
> 

```
import boto3
s3 = boto3.resource('s3',aws_access_key_id='demo', aws_secret_access_key='demo')

my_bucket = s3.Bucket('demo')

for file in my_bucket.objects.all():
    # print(file.key)
    print(max(file.last_modified))

```