Current location - Training Enrollment Network - Mathematics courses - When will the number of days increase by 1 instead of 1?
When will the number of days increase by 1 instead of 1?
Add 1 to include the start and end dates and subtract 1 to exclude them.

In mathematics, the problem of even spacing is the same as that of planting trees. When calculating the number of days between two dates, subtract the original date from the last date, and then subtract 1.

When an end date or a start date is included, the end date is directly used to subtract the start date. When calculating the end date and start date, the end date is used to subtract the start date and then add 1. For example, the time from 1 to 10 is 10 days. If 10- 1=9, only