doubledate.eoq#

doubledate.eoq(date: date, offset: int = 0) date#

Returns the end of the quarter, i.e. one of 31 March, 30 June, 30 September or 31 December, then optionally offsets it by offset quarters.

Parameters:
  • date (datetime.date) – the date from which to compute the end of the quarter

  • offset (int, optional) – an offset from the end of the quarter of the date

Returns:

The end of the quarter

Return type:

datetime.date

Examples

>>> today = datetime.date(2020, 1, 15)
>>> eoq(today):
datetime.date(2020,3,31)
>>> soq(today, 1)
datetime.date(2020,6,30)