Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check how many days old file is python

>>> import datetime
>>> today = datetime.datetime.today()
>>> modified_date = datetime.datetime.fromtimestamp(os.path.getmtime('yourfile'))
>>> duration = today - modified_date
>>> duration.days > 90 # approximation again. there is no direct support for months.
True
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #days #file #python
ADD COMMENT
Topic
Name
4+6 =