polars.Series.dt.millisecond#

Series.dt.millisecond() Series[source]#

Extract the milliseconds from the underlying DateTime representation.

Applies to Datetime columns.

Returns:
Series

Series of data type UInt32.

Examples

>>> from datetime import datetime
>>> start = datetime(2001, 1, 1)
>>> stop = datetime(2001, 1, 1, 0, 0, 4)
>>> s = pl.datetime_range(start, stop, interval="500ms", eager=True)
>>> s.dt.millisecond()
shape: (9,)
Series: 'datetime' [u32]
[
        0
        500
        0
        500
        0
        500
        0
        500
        0
]