#coding=utf-8

import os
import time

file_atime=int(os.path.getatime('d:\\a.txt'))
print "file_atime:",file_atime
time_arr=time.localtime(file_atime)
print 'time_arr:',time_arr

print "regular time:",time.strftime('%Y-%m-%d %H:%M:%S',time_arr)


c:\Python27\Scripts>python task_test.py
file_atime: 1522027881
time_arr: time.struct_time(tm_year=2018, tm_mon=3, tm_mday=26, tm_hour=9, tm_min=31, tm_sec=21, tm_wday=0, tm_yday=85, tm_isdst=0)
regular time: 2018-03-26 09:31:21

相关文章:

  • 2021-11-19
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-12-31
  • 2021-07-06
  • 2021-08-12
相关资源
相似解决方案