I try to wire a little script in order to find if a directory file was created in the las 24 hours
import time
path = /some/path/dir
currentTime = time.strftime("%c")
print currentTime # Tue Sep 15 18:08:54 2015
if os.path.isdir(path):
created = time.ctime(os.path.getctime(path))
print created # Thu Sep 25 17:29:28 2014
if created > 24 hours: # time don't have comparison
# do someting
So i trying with "datetime" and .timedelta to perform the maths, but i not able to get the creation time from the directory.
import datetime
print datetime.datetime(os.path.getctime(path))
# AttributeError: 'module' object has no attribute 'datetimep'
Thanks for your time :D