I am playing a bit with AWS via python and boto. I am trying to get modified date for keys from AWS bucket. After that I am parsing date to 'regular' date format and try to add every value to list.
Unfortunately, when I append values to list and try to print it's results I am getting datetime function instead of string with date.
Code looks like this:
import boto
s3 = boto.connect_s3()
bucket = s3.get_bucket('mybucket')
keys = bucket.list
keys_latest_modified_date_list = []
for key in keys:
key_latest_modified_date = boto.utils.parse_ts(key.last_modified)
keys_latest_modified_date_list.append(key_latest_modified_date)
print key_latest_modified_date
print keys_latest_modified_date_list
First print returns correct date:
2015-02-18 10:11:58
While second print gives me something like this:
[datetime.datetime(2015, 2, 18, 10, 11, 58)]
Does anyone know how to print values from list like in first print instead of this what I get from second one?