【问题标题】:How to get the last modify time for a file in s3 with python boto3?如何使用python boto3获取s3中文件的最后修改时间?
【发布时间】:2017-12-21 22:44:52
【问题描述】:

正如标题所说。如何使用 python-boto3 获取 amazon-s3 中文件的最后修改时间?谢谢。

【问题讨论】:

标签: python amazon-s3 boto3


【解决方案1】:

在boto3中,可以使用s3.client.head_object()

这将返回特定对象的元数据字典。您只需要查看 LastModified 元素。

'LastModified': datetime(2015, 1, 1)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-27
    • 1970-01-01
    • 2010-10-05
    • 2012-05-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多