参考链接: Python strptime()
一, datetime.datetime()
import datetime
dt = datetime.datetime(year=2019,month...=11,day=4,hour=10,minute=30)
dt
datetime.datetime(2019, 11, 4, 10, 30)
print(dt)
2019-11-04 10:30:00...()
pd.to_datetime('2019-11-4')
# pd.to_datetime('11/4/2019')
Timestamp(‘2019-11-04 00:00:00’)
s = pd.Series...(date, '%Y-%m-%d') for date in dates]
dates[:5]
[datetime.datetime(2016, 1, 1, 0, 0), datetime.datetime...(2016, 1, 2, 0, 0), datetime.datetime(2016, 1, 3, 0, 0), datetime.datetime(2016, 1, 4, 0, 0), datetime.datetime