I have a Pandas Dataframe that has a timestamp column. I would like to display only the date portion of it and not the hh:mm:ss portion. I tried using to_datetime function but it did not remove the time component. Could anyone assist on this. Thanks
input date : 2018-05-03 07:20:17
date = pd.to_datetime(df["FileReceivedTime"], format="%Y%m%d%")
date
Output : 2018-05-03 07:20:17
You can add this:
dt.strftime('%Y/%m/%d')
in
date = pd.to_datetime(df["FileReceivedTime"], format="%Y%m%d%").dt.strftime('%Y/%m/%d')