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  TypeScript code snippet - using log How can we find number of digits for a number in java?

Leave a Reply

Your email address will not be published. Required fields are marked *

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