The previous answers are correct but it’s generally a better practice to do:
import datetime
Then you’ll have, using datetime.timedelta
:
date_1 = datetime.datetime.strptime(start_date, "%m/%d/%y")
end_date = date_1 + datetime.timedelta(days=10)
More Related Contents:
- Format timedelta to string
- How to print a date in a regular format?
- Iterating through a range of dates in Python
- How do I get the day of week given a date?
- Creating a range of dates in Python
- Convert Excel style date with pandas
- How do I get a value of datetime.today() in Python that is “timezone aware”?
- Get month name from number
- subtract two times in python
- Convert timedelta to years?
- Find the end of the month of a Pandas DataFrame Series
- How to format date string via multiple formats in python
- In Python, how do you convert seconds since epoch to a `datetime` object?
- Check if string has date, any format
- How to add delta to python datetime.time?
- Generate a list of datetimes between an interval
- Splitting timestamp column into separate date and time columns
- Extract day of year and Julian day from a string date
- Convert numpy.datetime64 to string object in python
- Comparing two date strings in Python
- Convert date to datetime in Python
- Which is the fastest way to extract day, month and year from a given date?
- Comparing a time delta in python
- calculate the difference between two datetime.date() dates in years and months
- Formatting “yesterday’s” date in python
- Keep a datetime.date in ‘yyyy-mm-dd’ format when using Flask’s jsonify
- Clean way to convert quarterly periods to datetime in pandas
- Python: Adding hours to pandas timestamp
- How do I convert timestamp to datetime.date in pandas dataframe?
- Convert dates to pd.to_datetime where month could be either a number or month name