pandas.tseries.offsets.Day#

class pandas.tseries.offsets.Day#

Offset n days.

Represents a calendar-day offset for use in arithmetic with datetime, Timestamp, or other datetime-like objects. Addition and subtraction shift the value by exactly n calendar days, with time-of-day preserved.

Parameters:
nint, default 1

The number of days represented.

See also

DateOffset

Standard kind of date increment.

Examples

You can use the parameter n to represent a shift of n days.

>>> from pandas.tseries.offsets import Day
>>> ts = pd.Timestamp(2022, 12, 9, 15)
>>> ts
Timestamp('2022-12-09 15:00:00')
>>> ts + Day()
Timestamp('2022-12-10 15:00:00')
>>> ts - Day(4)
Timestamp('2022-12-05 15:00:00')
>>> ts + Day(-4)
Timestamp('2022-12-05 15:00:00')