Is there any way to get from a date to the next period? I.e. I am looking for a funaction next
that takes
now = datetime.datetime(2013, 11, 15, 0, 0)
to
next(now, 'D') = datetime.datetime(2013, 11, 16, 0, 0) #moving to next day
next(now, 'M') = datetime.datetime(2013,12,31) #moving to next month (day doesn't matter really)
I have tried using Day and MonthEnd from pandas.tseries.offsets but MonthEnd will convert to MonthEnd of the given month, not next month. Is there any simple way to do this?
EDIT: I know this is fairly easy for months. Or days. The problem is, what if I then decide to use business days (Alias 'B')? Or BusinessMonthEnd ('BM')? Surely there should be a method that works for any of these, without having to think about how to implement business days?