def next_month(date):
    """return a date one month in advance of 'date'. 
    If the next month has fewer days then the current date's month, this will return an
    early date in the following month."""
return date + datetime.timedelta(days=calendar.monthrange(date.year, date.
    month)[1])
how to get the same day of next month of a given day in python using datetime