The last_modified property of a s3.key.Key does not always have the same format
>>> import boto
>>> cx = boto.connect_s3("XXXX", "XXXX")
>>> bucket = cx.get_bucket("mybucket")
>>> rs = bucket.get_all_keys()
'Thu, 29 Dec 2011 12:51:15 GMT'
I do not find any time conversion functions in boto. Does AWS return the "Last-Modified" header differently for different requests?
Yes, S3 does actually return two different format datestrings.
When listing a bucket (GET on bucket) see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGET.html for details.
When retrieve an object (GET on object) see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGET.html for details.
Perhaps boto should be normalizing these.
mrjob ran into this issue recently and has a fix: https://github.com/Yelp/mrjob/blob/master/mrjob/emr.py#L203
(The comment in the code blames boto, but it's really Amazon's fault. I wrote the comment before I read this issue, sorry guys!)
We feel it is better to return the timestamps as they are returned by the service. Closing.