Start Date
Number of days to add or subtract
Add years, months or weeks
How to Add or Subtract Days to a Date
- Convert the date to a datetime object. You can use the datetime.datetime() function to do this.
- Add or subtract the desired number of days to the datetime object. You can use the datetime.timedelta() function to do this.
- Convert the datetime object back to a date. You can use the datetime.date() function to do this.
import datetime # Convert the date to a datetime object. date = datetime.datetime(2023, 9, 27) # Add 10 days to the date. new_date = date + datetime.timedelta(days=10) # Subtract 5 days from the date. new_date = date - datetime.timedelta(days=5) # Print the new date. print(new_date)
2023-10-07 2023-09-22
- Create a new Date object. You can do this using the new Date() constructor.
- Set the date of the Date object. You can use the setDate() method to do this.
- Add or subtract the desired number of days to the Date object. You can use the setDate() method to do this, passing in the new day of the month.
- Return the Date object.
// Create a new Date object. const date = new Date(); // Add 10 days to the date. date.setDate(date.getDate() + 10); // Subtract 5 days from the date. date.setDate(date.getDate() - 5); // Return the Date object. console.log(date);
2023-10-07T00:00:00.000Z 2023-09-22T00:00:00.000Z
// Create a new Date object. const date = new Date(); // Add 10 days to the date. date.addDays(10); // Subtract 5 days from the date. date.subtractDays(5);
2023-10-07T00:00:00.000Z 2023-09-22T00:00:00.000Z
Days from Today / Days From Now
Calendar Days from Today (Sunday, 28 Apr 2024) | Date |
---|---|
5 days from today | Friday, 3 May 2024 |
7 days from today | Sunday, 5 May 2024 |
10 days from today | Wednesday, 8 May 2024 |
14 days from today | Sunday, 12 May 2024 |
15 days from today | Monday, 13 May 2024 |
20 days from today | Saturday, 18 May 2024 |
21 days from today | Sunday, 19 May 2024 |
28 days from today | Sunday, 26 May 2024 |
30 days from today | Tuesday, 28 May 2024 |
31 days from today | Wednesday, 29 May 2024 |
35 days from today | Sunday, 2 Jun 2024 |
40 days from today | Friday, 7 Jun 2024 |
42 days from today | Sunday, 9 Jun 2024 |
50 days from today | Monday, 17 Jun 2024 |
56 days from today | Sunday, 23 Jun 2024 |
60 days from today | Thursday, 27 Jun 2024 |
75 days from today | Friday, 12 Jul 2024 |
80 days from today | Wednesday, 17 Jul 2024 |
90 days from today | Saturday, 27 Jul 2024 |
100 days from today | Tuesday, 6 Aug 2024 |
120 days from today | Monday, 26 Aug 2024 |
150 days from today | Wednesday, 25 Sep 2024 |
180 days from today | Friday, 25 Oct 2024 |
360 days from today | Wednesday, 23 Apr 2025 |
Business Days from Today / Business Days From Now
Business Days from Today (Sunday, 28 Apr 2024) | Date |
---|---|
2 business days from today | Wednesday, 1 May 2024 |
3 business days from today | Thursday, 2 May 2024 |
4 business days from today | Friday, 3 May 2024 |
5 business days from today | Monday, 6 May 2024 |
6 business days from today | Tuesday, 7 May 2024 |
7 business days from today | Wednesday, 8 May 2024 |
8 business days from today | Thursday, 9 May 2024 |
9 business days from today | Friday, 10 May 2024 |
10 business days from today | Monday, 13 May 2024 |
12 business days from today | Wednesday, 15 May 2024 |
14 business days from today | Friday, 17 May 2024 |
15 business days from today | Monday, 20 May 2024 |
20 business days from today | Monday, 27 May 2024 |
21 business days from today | Tuesday, 28 May 2024 |
28 business days from today | Thursday, 6 Jun 2024 |
30 business days from today | Monday, 10 Jun 2024 |
31 business days from today | Tuesday, 11 Jun 2024 |
35 business days from today | Monday, 17 Jun 2024 |
40 business days from today | Monday, 24 Jun 2024 |
42 business days from today | Wednesday, 26 Jun 2024 |
45 business days from today | Monday, 1 Jul 2024 |
50 business days from today | Monday, 8 Jul 2024 |
56 business days from today | Tuesday, 16 Jul 2024 |
60 business days from today | Monday, 22 Jul 2024 |
75 business days from today | Monday, 12 Aug 2024 |
80 business days from today | Monday, 19 Aug 2024 |
90 business days from today | Monday, 2 Sep 2024 |
100 business days from today | Monday, 16 Sep 2024 |
120 business days from today | Monday, 14 Oct 2024 |
150 business days from today | Monday, 25 Nov 2024 |
180 business days from today | Monday, 6 Jan 2025 |
360 business days from today | Monday, 15 Sep 2025 |
Add Date Calculator
Formula for Calendar Add Days and Subtract Days
A. To Add days to a given date
Create date with given start date in string format start Date = new Date(start date in string);
0 means same day, -1 previous day, +32 goes into next month and adds remaining days of that month.
To subtract, pass -ve value and the days will be computed
The return value of the set Date is time in milliseconds format
Convert the timestamp to readable text format
Add Business Days / Add Work Days Calculator
1. To add work days or business days to start date
Find number of weeks - assuming 5 business days, find the number of weeks
Number of days / 5 = weeks
Take whole part for weeks and remainder part for days
Number of days % 5 = remainder days
week count = truncate (number of days / 5);
day count= number of days % 5;
Multiply by 7 to get actual calendar days use that to add to the start date
days to add = weekCount * 7 + dayCount;
Get the day information. If it is 6 (friday), then add 2 to the number of days
If it is 0 (Sunday), then add 1 to the number of days