1. 使用pd.DatetimeIndex(),该函数有较多的属性和方法,参考官方文档https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.html。