code_junkie

How do I get the modified date/time of a file in Python?

Nov 11th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. os.path.getmtime(filepath)
  2.  
  3. os.stat(filepath).st_mtime
  4.  
  5. import time
  6. print time.strftime("%m/%d/%Y %I:%M:%S %p",time.localtime(os.path.getmtime(fname)))
Add Comment
Please, Sign In to add comment