How to add days to a date in Python

If you have a date in Python of type datetime and you want to add certain days to the date, you can make use of the timedelta class from the same datetime module.

Let's take a look at an example:

from datetime import date, timedelta

date_today =

days_to_add = 10

new_date = date_today + timedelta(days=days_to_add)

print(f"Date after adding {days_to_add} days to {date_today} is {new_date}")
Date after adding 10 days to 2023-07-06 is 2023-07-16
Add days to date example Python

Facing issues? Have Questions? Post them here! I am happy to answer!

Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap