pandas.tseries.holiday.next_monday#
- pandas.tseries.holiday.next_monday(dt)[source]#
Move Saturday and Sunday to the following Monday.
A holiday on a weekday keeps its date.
- Parameters:
- dtdatetime
The date the holiday falls on.
- Returns:
- datetime
The date the holiday is observed on.
See also
tseries.holiday.weekend_to_mondayMove Saturday and Sunday to the following Monday.
tseries.holiday.next_monday_or_tuesdayMove Saturday to Monday, and Sunday or Monday to Tuesday.
tseries.holiday.HolidayClass that defines a holiday with start/end dates and rules for observance.
Examples
>>> from datetime import datetime >>> from pandas.tseries.holiday import next_monday >>> next_monday(datetime(2022, 1, 1)) # Saturday datetime.datetime(2022, 1, 3, 0, 0) >>> next_monday(datetime(2022, 1, 2)) # Sunday datetime.datetime(2022, 1, 3, 0, 0)