Subscribe for future Changes.. Explanation soon..
This is short and sweet method to add a month in a date using
This is short and sweet method to add a month in a date using
relativedelta
.from datetime import datetime
from dateutil.relativedelta import relativedelta
date_after_month = datetime.today()+ relativedelta(months=1)
print 'Today: ',datetime.today().strftime('%d/%m/%Y')
print 'After Month:', date_after_month.strftime('%d/%m/%Y')
Output:
Today: 01/03/2013After Month: 01/04/2013
No comments:
Post a Comment