pandas.tseries.offsets.Milli#

class pandas.tseries.offsets.Milli#

Offset n milliseconds.

Represents a fixed duration of n milliseconds (1/1000 of a second) for use in arithmetic with datetime-like objects. Supports sub-second precision in time-series operations.

Parameters:
nint, default 1

The number of milliseconds represented.

See also

DateOffset

Standard kind of date increment.

Examples

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

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