2008-09-23 5 views

답변

38
os.path.getmtime(filepath) 

또는

os.stat(filepath).st_mtime 
+0

이다? :) – endolith

+1

@endolith : http://stackoverflow.com/a/237082/125507는 "os.path.getmtime()이이를 위해 만들어졌으며 더 간단합니다." – endolith

19

형식의이 : 더 나은

import time 
print time.strftime("%m/%d/%Y %I:%M:%S %p",time.localtime(os.path.getmtime(fname))) 
+0

게시 해 주셔서 감사합니다. –

관련 문제