1

Just as the title said.How can I use python-boto3 to get the last modify time for a file in amazon-s3? Thanks.

live2
  • 3,771
  • 2
  • 37
  • 46
cat.zhang
  • 11
  • 1
  • 2
  • Check this https://stackoverflow.com/questions/9679344/how-can-i-get-last-modified-datetime-of-s3-objects-with-boto – live2 Dec 21 '17 at 09:01

1 Answers1

2

In boto3, you can use s3.client.head_object()

this will return a dict of meta data for the particular object. You just need to look into the LastModified element.

'LastModified': datetime(2015, 1, 1)
mootmoot
  • 12,845
  • 5
  • 47
  • 44