Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

timedelta

>>> import datetime
>>> d1 = datetime.date.today()
>>> from dateutil.relativedelta import relativedelta
>>> d1 + relativedelta(months=1)
datetime.date(2012, 4, 8)

>>> d2 = datetime.date(year=2012,month=1,day=31)
>>> d2 + relativedelta(months=1)
datetime.date(2012, 2, 29)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #timedelta
ADD COMMENT
Topic
Name
8+5 =