How to increment datetime by custom months in python without using library

I need to increment the month of a datetime value next_month = datetime.datetime(mydate.year, mydate.month+1, 1) when the month is 12, it becomes 13 and raises error “month must be in 1..12”. (I expected the year would increment) I wanted to use timedelta, but it doesn’t take month argument. There is relativedelta python package, but i … Read more