polars.Series.dt.date#

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

Extract (local) date.

Applies to Date/Datetime columns.

Returns:
Series

Series of data type Date.

Examples

>>> from datetime import datetime
>>> ser = pl.Series([datetime(2021, 1, 2, 5)]).dt.replace_time_zone(
...     "Asia/Kathmandu"
... )
>>> ser
shape: (1,)
Series: '' [datetime[μs, Asia/Kathmandu]]
[
        2021-01-02 05:00:00 +0545
]
>>> ser.dt.date()
shape: (1,)
Series: '' [date]
[
        2021-01-02
]