Python 如何在pandas.Timestamp.today()函数中仅保留日期YYYY-MM-DD?

Python 如何在pandas.Timestamp.today()函数中仅保留日期YYYY-MM-DD?,python,pandas,timestamp,time-series,Python,Pandas,Timestamp,Time Series,我想去掉today()函数中的时间: Today=pd.Timestamp.Today() 印刷(今日) 结果=2020-02-2812:10:11.862889 我只想要2020-02-28,摆脱12:10:11.862889 谢谢你 pd.to_datetime(“%now”).strftime(“%Y-%m-%d”)或pd.Timestamp.today().strftime(“%Y-%m-%d”)有效!令人惊叹的!请你把它写下来作为答案好吗?

我想去掉today()函数中的时间:

Today=pd.Timestamp.Today() 印刷(今日)

结果=2020-02-2812:10:11.862889

我只想要2020-02-28,摆脱12:10:11.862889


谢谢你

pd.to_datetime(“%now”).strftime(“%Y-%m-%d”)
pd.Timestamp.today().strftime(“%Y-%m-%d”)
有效!令人惊叹的!请你把它写下来作为答案好吗?