from datetime import date, timedelta
t = time.strptime('20110531', '%Y%m%d')
newdate = date(t.tm_year, t.tm_mon, t.tm_mday) + timedelta(1)
print(newdate.strftime('%Y%m%d'))
calculating the next day from a "YYYYMMDD" formated string