pandas.tseries.holiday.sunday_to_monday#
- pandas.tseries.holiday.sunday_to_monday(dt)[source]#
Move Sunday to the following Monday.
A holiday on a Saturday stays where it is.
- 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.nearest_workdayMove Saturday to Friday and Sunday to Monday.
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 sunday_to_monday >>> sunday_to_monday(datetime(2022, 1, 2)) # Sunday datetime.datetime(2022, 1, 3, 0, 0) >>> sunday_to_monday(datetime(2022, 1, 1)) # Saturday, unchanged datetime.datetime(2022, 1, 1, 0, 0)