# pyspark.pandas.DatetimeIndex.normalize¶

DatetimeIndex.normalize() → pyspark.pandas.indexes.datetimes.DatetimeIndex[source]

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.

Returns
DatetimeIndex

The same type as the original data.

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

>>> idx = ps.date_range(start='2014-08-01 10:00', freq='H', periods=3)
>>> idx.normalize()
DatetimeIndex(['2014-08-01', '2014-08-01', '2014-08-01'], dtype='datetime64[ns]', freq=None)