从:
http://docs.python.org/py3k/library/datetime.html#timedelta-objects
timedelta 对象表示持续时间,即两个日期或时间之间的差异。
那么为什么我会出错:
>>> from datetime import datetime, timedelta, time
>>> datetime.now() + timedelta(hours=12)
datetime.datetime(2012, 9, 17, 6, 24, 9, 635862)
>>> datetime.now().date() + timedelta(hours=12)
datetime.date(2012, 9, 16)
>>> datetime.now().time() + timedelta(hours=12)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta'