You should be using datetime.datetime.strptime. Note that very old versions of Python (2.4 and older) don’t have datetime.datetime.strptime; use time.strptime in that case.
You should be using datetime.datetime.strptime. Note that very old versions of Python (2.4 and older) don’t have datetime.datetime.strptime; use time.strptime in that case.