To your first question about comparing to a specific date:
import datetime
filedate = datetime.fromtimestamp(os.path.getmtime(rootpath + "/" + fName)) #filedate = datetime.date(2014, 1, 27)
today = datetime.now
maxdate = datetime.date(2011, 7, 2)
#Only do work if the number of days since the last change is less than the number of days since a 'too long ago' date.
if (filedate - today).days < (filedate - maxdate).days:
print('Work on this file')
else:
print('Do nothing')
When I try and test the 2nd issue you bring up, I don't see the same result as you:
>>> import datetime
>>> test = datetime.date(2011, 7, 2)
>>> print test
2011-07-02
>>> str(test)
'2011-07-02'
>>>
It works for me as would be expected, so I don't have a good answer for you regarding that issue.- Doug