python 获取文件夹的日期

def getDirDate(alName):
    alRootPath = IP + rootPath + '/' + alName
    if os.path.exists(alRootPath):
        date = os.path.getmtime(alRootPath)
        timeStruct = time.localtime(date)
        timeStr = time.strftime('%Y-%m-%d %H:%M:%S',timeStruct)
        return timeStr

 

 

https://blog.csdn.net/qiqiyingse/article/details/83993098

posted @ 2021-05-23 18:53  bH1pJ  阅读(197)  评论(0编辑  收藏  举报