polars.internals.expr.ExprDateTimeNameSpace.and_time_unit

ExprDateTimeNameSpace.and_time_unit(tu: str, dtype: Type[polars.datatypes.DataType] = <class 'polars.datatypes.Datetime'>) polars.internals.expr.Expr

Set time unit a Series of type Datetime. This does not modify underlying data, and should be used to fix an incorrect time unit.

..deprecated::

Use with_time_unit

Parameters
tu

Time unit for the Datetime Series: any of {“ns”, “us”, “ms”}

dtype

Output data type.