I am trying to get the last modification date and time of a directory. while doing that I want to include the last modified date of the sub directories as well.
I could find some topics related to this question.(How to get file creation & modification date/times in Python?) but all of those just gives the last modified time of the root directory without considering the sub directories.
import os.path, time
print "last modified: %s" % time.ctime(os.path.getmtime(file))
print "created: %s" % time.ctime(os.path.getctime(file))
These lines of code just gives the last modified time of the root directory without considering the sub directories. Please help me on this.