Skip to content

Add n days to today’s date in Python


from datetime import datetime, timedelta

#Current day
#2020-12-13 05:01:30.689604

#Add five days
print + timedelta(5)
#2020-12-18 05:01:30.689652

#Add One day
print + timedelta(1)
#2020-12-14 05:01:30.689684

See also  How to get prime numbers in a list in Python using list comprehension?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.