How to see if file is older than 3 months in Python?
time.time() - os.path.getmtime(oldLoc) > (3 * 30 * 24 * 60 * 60)
You can use a bit of datetime arthimetic here for the sake of clarity.
>>> 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