pandas.tseries.offsets.Second#

class pandas.tseries.offsets.Second#

Offset n seconds.

Represents a fixed duration of n seconds for use in arithmetic with datetime-like objects. The smallest tick offset that does not involve fractional seconds.

Parameters:
nint, default 1

The number of seconds represented.

See also

DateOffset

Standard kind of date increment.

Examples

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

>>> from pandas.tseries.offsets import Second
>>> ts = pd.Timestamp(2022, 12, 9, 15)
>>> ts
Timestamp('2022-12-09 15:00:00')
>>> ts + Second(n=10)
Timestamp('2022-12-09 15:00:10')
>>> ts - Second(n=10)
Timestamp('2022-12-09 14:59:50')
>>> ts + Second(n=-10)
Timestamp('2022-12-09 14:59:50')