How do I get the modified datetime of a file in Python

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

   This question already has an answer here:
    * /questions/237079/how-to-get-file-creation-modification-date-times-in-python /questions/237079/how-to-get-file-creation-modification-date-times-in-python 10 answers

Answers

os.path.getmtime(filepath)

or

os.stat(filepath).st_mtime

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/121025/how-do-i-get-the-modified-date-time-of-a-file-in-python

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils