I think you are looking for a replace method (see docs ):
In [18]: ts Out[18]: Timestamp('2014-11-12 13:35:00') In [19]: ts.replace(hour=0) Out[19]: Timestamp('2014-11-12 00:35:00')
This is a method inherited from datetime.datetime
If you want to reset the full part of the time, you specify all the parts in replace :
In [20]: ts.replace(hour=0, minute=0, second=0) Out[20]: Timestamp('2014-11-12 00:00:00')
There is also a DatetimeIndex.normalize method, but this is not available for individual timestamps (I discovered a problem for it: https://github.com/pydata/pandas/issues/8794 ):
In [21]: pd.DatetimeIndex([ts]).normalize()[0] Out[21]: Timestamp('2014-11-12 00:00:00')
joris Nov 12 '14 at 9:49 2014-11-12 09:49
source share