pandas.tseries.offsets.Easter.is_on_offset#

Easter.is_on_offset(dt)#

Return boolean whether a timestamp intersects with this frequency.

This method determines if a given timestamp falls on Easter Sunday, as defined by the calculation method specified in the offset. If normalize is True, it also checks that the time component is midnight.

Parameters:
dtdatetime

Timestamp to check intersection with frequency.

Returns:
bool

True if the timestamp falls on Easter Sunday, False otherwise.

See also

tseries.offsets.Easter

DateOffset for the Easter holiday.

Examples

>>> ts = pd.Timestamp(2022, 4, 17)
>>> pd.offsets.Easter().is_on_offset(ts)
True
>>> ts = pd.Timestamp(2022, 4, 18)
>>> pd.offsets.Easter().is_on_offset(ts)
False