Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in <module> ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime
# cat timefix.py #!/usr/bin/python3.4 import subprocess import sys from datetime import datetime import datetime from time import gmtime, strftime pretime = strftime("%Y%m%d%H", gmtime()) time = datetime.datetime.strptime(pretime,'%Y%m%d%H') print(pretime) print (time) plustime = datetime.timedelta(days=730) timeadd = (time + plustime) str(timeadd) ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') #timeadd = timeadd.replace(tzinfo=UTC()) print (timeadd) print (ndate) -- https://mail.python.org/mailman/listinfo/python-list