Python返回文件修改时间

import datetime
import os.path


def getModifyTime(filename):
    tt = datetime.datetime.fromtimestamp(os.path.getmtime(filename))
    return tt.strftime("%Y/%m/%d %H:%M:%S")
原文地址:https://www.cnblogs.com/yanweichen/p/15255342.html