I'm having some confusion on some of my code which was previously working (yesterday). Using python 2.7.6
I had
from datetime import datetime
openfor = (datetime.strptime(row[1],"%Y-%m-%d %H:%M:%S") - datetime.strptime(row[2], "%Y-%m-%d %H:%M:%S")).total_seconds()
and it returned the value that is required. As of this morning it is generating
AttributeError: 'module' object has no attribute 'strptime'
If I use the below, with or without the import it works.
openfor = (datetime.datetime.strptime(row[1],"%Y-%m-%d %H:%M:%S") - datetime.datetime.strptime(row[2], "%Y-%m-%d %H:%M:%S")).total_seconds()
It is no real big deal, because it works, but the code looks ugly and my curiosity is piqued. So any suggestions on why this would stop working? And how to resolve? Thanks