pyspark.pandas.Series.dt.normalize

dt.normalize() → pyspark.pandas.series.Series

Convert times to midnight.

The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected.

This method is available on Series with datetime values under the .dt accessor, and directly on Datetime Array.

Returns
Series

The same type as the original data. Series will have the same name and index.

See also

floor

Floor the series to the specified freq.

ceil

Ceil the series to the specified freq.

round

Round the series to the specified freq.

Examples

>>> series = ps.Series(pd.Series(pd.date_range('2012-1-1 12:45:31', periods=3, freq='M')))
>>> series.dt.normalize()
0   2012-01-31
1   2012-02-29
2   2012-03-31
dtype: datetime64[ns]