pandas.tseries.holiday.after_nearest_workday#

pandas.tseries.holiday.after_nearest_workday(dt)[source]#

Move to the workday after the nearest workday.

Needed for Boxing Day, or for several holidays in a row.

Parameters:
dtdatetime

The date the holiday falls on.

Returns:
datetime

The date the holiday is observed on.

See also

tseries.holiday.nearest_workday

Move Saturday to Friday and Sunday to Monday.

tseries.holiday.before_nearest_workday

Move to the workday before the nearest workday.

tseries.holiday.next_workday

Move to the next weekday.

Examples

>>> from datetime import datetime
>>> from pandas.tseries.holiday import after_nearest_workday
>>> after_nearest_workday(datetime(2022, 1, 1))  # Saturday
datetime.datetime(2022, 1, 3, 0, 0)
>>> after_nearest_workday(datetime(2022, 1, 2))  # Sunday
datetime.datetime(2022, 1, 4, 0, 0)