hi, all:
I have some tried as follows. it works perfect.
>>> import datetime
>>> today = datetime.datetime.now()
>>> today+datetime.timedelta(weeks=1)
datetime.datetime(2012, 1, 16, 11, 52, 8, 33220)
>>> today+datetime.timedelta(days=1)
datetime.datetime(2012, 1, 10, 11, 52, 8, 33220)
>>> help(datetime)
when i run this piece of code, it failed.
>>> today+datetime.timedelta(months=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'months' is an invalid keyword argument for this function
I try to read the source code, but find it
NAME
datetime - Fast implementation of the datetime type.
FILE
/usr/lib/python2.6/lib-dynload/datetime.so
In one word, in the method "datetime.timedelta(months=1)", what are the keys in the method?
if i want to know what key can be used in timedelta(), how should i do ?
-- Jia Xiaolei