tag.py 482 B

1234567891011121314151617
  1. # -*- coding: UTF8 -*-
  2. import os
  3. import time
  4. def TimeStampToTime(timestamp):
  5. timeStruct = time.localtime(timestamp)
  6. return time.strftime('%Y-%m-%d %H:%M:%S', timeStruct)
  7. def get_FileModifyTime(filePath):
  8. # '''获取文件的修改时间'''
  9. # filePath = unicode(filePath, 'utf8')
  10. t = os.path.getmtime(filePath)
  11. return TimeStampToTime(t)
  12. if __name__ == '__main__':
  13. path = r"D:\Desktop\kevin_picture_alg_need_collect"
  14. print(get_FileModifyTime(path))