#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:Python27Scripts>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