可能重复:
Python - easy way to add N seconds to a datetime.time?
How to create a DateTime equal to 15 minutes ago?
最好的方法是什么?
答案 0 :(得分:20)
d1 = datetime.datetime.now() + datetime.timedelta(minutes=15)
d2 = datetime.datetime.now() + datetime.timedelta(hours=1)