doubledate.ceil#
- doubledate.ceil(date: date, frequency: str) date #
Returns the end of the frequency (e.g. quarter) for the date passed as first argument.
- Parameters:
date (datetime-like) – the date to offset
frequency (str) – one of Y, H, Q, M, W or W-MON…W-SUN for, respectively, year, semester, quarter, month, week (or specific weekday)
Examples
>>> ceil(datetime.date(2020, 4, 10), "Y") datetime.date(2020, 12, 31) #end of year
>>> ceil(datetime.date(2020, 7, 4), "Q") datetime.date(2020, 9, 30) #end of quarter