import pandas as pd
import datetime
def main():
foo = pd.Timestamp.now()
bar = datetime.date.today() + datetime.timedelta(days=-1)
res = bar + datetime.timedelta(hours=24)
print(res, type(res))
if __name__ == '__main__':
main()
datetime.date + datetime.timedelta 结果仍然是 datetime.date 因而不能与时间进行比较
标签:__,timedelta,res,datetime,date,main From: https://blog.51cto.com/u_16055028/9635217