def _getEndTime(self, t):
assert isinstance(t, datetime.datetime)<EOL>if self._aggTimeDelta:<EOL><INDENT>return t + self._aggTimeDelta<EOL><DEDENT>else:<EOL><INDENT>year = t.year + self._aggYears + (t.month - <NUM_LIT:1> + self._aggMonths) / <NUM_LIT:12><EOL>month = (t.month - <NUM_LIT:1> + self._aggMonths) % <NUM_LIT:12> + <NUM_LIT:1><EOL>return t.replace(year=year, month=month)<EOL><DEDENT>
Add the aggregation period to the input time t and return a datetime object

        Years and months are handled as aspecial case due to leap years
        and months with different number of dates. They can't be converted
        to a strict timedelta because a period of 3 months will have different
        durations actually. The solution is to just add the years and months
        fields directly to the current time.

        Other periods are converted to timedelta and just added to current time.