2008-09-23 3 views

Antwort

38
os.path.getmtime(filepath) 

oder

os.stat(filepath).st_mtime 
+0

was ist besser? :) – endolith

+1

@endolith: http://stackoverflow.com/a/237082/125507 sagt "os.path.getmtime() ist dafür gemacht, und einfacher." – endolith

19

Formated:

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

Danke für das Posten! –

Verwandte Themen