Whether you are counting down to a deadline, checking how long an event lasted, or working out your age, the same question sits behind each task: how many days separate two calendar dates? The date calculator answers it in one step, but the arithmetic is simple enough to follow by hand once you know how leap years and uneven month lengths work.
Enter a start date and an end date and the date calculator returns the time difference between them, in years, months, weeks, days, hours, minutes and seconds. The underlying relation is end date minus start date equals time difference. Counting by hand, you add the full years, then the whole months, then the leftover days, granting an extra day for each leap year in the span. The source counts 4 September 1999 to 2 January 2003 as 1,216 days.
What is the formula for the days between two dates?
The calculator's first equation is date1 + time_difference = date2: the start date plus the difference gives the end date. Rearranged, it gives the time difference directly.
The by-hand method breaks that difference into three pieces — full years, full months and remaining days — and adds them:
Here is the number of days in the whole years between the dates, the days in the whole months left over, and the remaining days. Applied to 4 September 1999 and 2 January 2003, the source breaks down like this:
| Component | Calculation in the source | Days |
|---|---|---|
| Full years, 1999 to 2002 | (2000 is a leap year) | 1,096 |
| Full months, October to December 2002 | 92 | |
| Remaining days | 28 | |
| Total, end date included | 1,216 | |
| Total, end date excluded | 1,215 |
Worked example: 4 September 1999 to 2 January 2003
Count the full years first. Adding years to the earlier date without passing the later one gets you from 4.09.1999 to 4.09.2002, so years. One of those years, 2000, is a leap year, hence days.
Next, count whole months: October, November and December. February has 28 days (29 in a leap year), September, April, June and November have 30, and the rest have 31. So days.
Finally, count the leftover days. September has 30 days, so days remain in the start month; add the 2 days of January in the end date to get . Adding the three parts, days between the two dates. If you do not want to include the end date, subtract one: .
When should I use a date difference calculator?
The source lists these everyday uses for counting the days between dates:
- How many days are left until a deadline or exam;
- How long an event lasts, such as a school year;
- How old you are in years, months, days or seconds;
- When you were, or will be, one billion seconds old;
- How many days remain until a wedding, vacation or other long-awaited day;
- How many days have passed since an event.
The date-to-date calculator counts all calendar days; it cannot count only working days or selected weekdays. For that, the source points to a day counter or a business days calculator that excludes weekends and custom holidays.
FAQ
How do I know if it is a leap year?
Divide the year by 4. If there is a remainder, it is not a leap year. If there is none, divide by 100: a remainder means it is a leap year. If 100 divides evenly too, divide by 400; only then is the year a leap year if 400 divides it without a remainder.
Can I see the difference in units other than days?
Yes. The date calculator displays the time between two dates in years, months, weeks, days, hours, minutes and seconds, so you can read the same gap at whatever granularity suits your task.
How is the Easter date calculated?
Easter falls in March or April. It is the first Sunday following the first full moon of spring, where that full moon appears on or after 21 March.
Can the calculator count only working days?
No. The source states that this date-to-date calculator cannot count only working days or selected weekdays. Use a day counter for specific weekdays or a business days calculator to exclude weekends and custom holidays.
References
- Omni Calculator, "Date Calculator" — source article for the date-difference equations, hand-counting method, worked example and FAQ.
- Standard Gregorian calendar conventions for month lengths and leap years.
- General arithmetic references on counting the elapsed days between two dates.