Date Calculator
Last updated:
How to Use This Calculator
This calculator has two modes. Switch between them using the tabs at the top.
Days Between Dates (Tab 1):
Step 1: Enter the start date using the date picker or by typing directly.
Step 2: Enter the end date. The order does not matter — the calculator always returns a positive difference.
Step 3: Optionally check "Include end date" if you want to count both the start and end dates (adds 1 day to the result). This is useful for counting inclusive days, such as rental periods or event durations.
Step 4: Click Calculate. The result shows the exact number of days, plus approximate weeks, months, and years.
Add / Subtract (Tab 2):
Step 1: Enter a start date.
Step 2: Select Add (+) or Subtract (−) from the operation dropdown.
Step 3: Enter the duration using the Years, Months, Weeks, and Days fields. You can fill in any combination — for example, just months, or years and days together.
Step 4: Click Calculate. The result shows the exact resulting date and the total number of days from your start date.
Understanding Date Calculations and the Calendar System
Calculating the difference between two dates is more complex than simple subtraction because of the irregularities in our calendar system. Months have different lengths (28, 29, 30, or 31 days), years can be 365 or 366 days, and leap years add an extra day every four years with specific exceptions.
The Gregorian calendar, used worldwide for civil purposes, was introduced by Pope Gregory XIII in 1582 to correct a drift in the older Julian calendar. The Julian calendar assumed a year was exactly 365.25 days long, but the actual solar year is approximately 365.2422 days. By 1582, the calendar had drifted 10 days from the solar year. The Gregorian reform introduced a more precise leap year rule.
Leap year rules: A year is a leap year if divisible by 4, except for years divisible by 100, unless also divisible by 400. So 2024 is a leap year, 1900 was not, and 2000 was. This rule keeps the calendar aligned to within 1 day every 3,236 years.
Adding months is not straightforward. Adding 1 month to January 31 does not give February 31 (which does not exist). This calculator handles this by clamping to the last valid day of the target month — so January 31 + 1 month = February 28 (or 29 in a leap year). Similarly, February 29 + 1 year = February 28 in a non-leap year.
The "include end day" option matters for counting inclusive periods. The difference between January 1 and January 31 is 30 days (exclusive) or 31 days (inclusive). Hotel stays, rental agreements, and event durations often require inclusive counting.
How Date Calculations Work
Days Between Two Dates:
The calculator converts both dates to milliseconds since January 1, 1970 (the Unix epoch), takes the absolute difference, and divides by 86,400,000 (milliseconds in a day).
Days = |Date2 − Date1| ÷ 86,400,000
This method automatically accounts for all month lengths, leap years, and calendar irregularities. The result is always exact.
Approximate conversions: Weeks = Days ÷ 7 (exact). Months ≈ Days ÷ 30.44 (average month). Years ≈ Days ÷ 365.25 (average year with leap days).
Adding/Subtracting from a Date:
The calculator processes units from largest to smallest: years first, then months, then weeks and days.
1. Add years by changing the year component directly
2. Add months by changing the month component, with day clamping if the target month has fewer days (Jan 31 + 1 month = Feb 28, not Mar 3)
3. Add weeks × 7 + days to the final date
This order matters. Adding 1 month then 1 day can give a different result than adding 1 day then 1 month, depending on the start date. The standard convention is years → months → days.
Days in Each Month — Reference Table
| Month | Days | Cumulative (Non-Leap) | Cumulative (Leap) |
|---|---|---|---|
| January | 31 | 31 | 31 |
| February | 28 / 29 | 59 | 60 |
| March | 31 | 90 | 91 |
| April | 30 | 120 | 121 |
| May | 31 | 151 | 152 |
| June | 30 | 181 | 182 |
| July | 31 | 212 | 213 |
| August | 31 | 243 | 244 |
| September | 30 | 273 | 274 |
| October | 31 | 304 | 305 |
| November | 30 | 334 | 335 |
| December | 31 | 365 | 366 |
Examples
Example 1: Counting Days to a Deadline
Your project is due December 15, 2026. Use the "Days Between Dates" tab. Enter today (March 20, 2026) as start and December 15, 2026 as end. Result: 270 days (38 weeks, approximately 8.9 months).
Example 2: Finding a Future Date
You need to schedule something 90 days from March 20, 2026. Use the "Add / Subtract" tab. Enter March 20 as start, select Add, and enter 90 in the Days field. Result: Thursday, June 18, 2026.
Example 3: Working Backwards from a Deadline
A contract expires on October 1, 2026 and you need to give 60 days notice. Use "Add / Subtract." Enter October 1 as start, select Subtract, and enter 60 days. Result: Sunday, August 2, 2026 — you must give notice by that date.
Example 4: Adding Months and Weeks
You want to know the date 6 months and 2 weeks from March 20, 2026. Enter March 20 as start, select Add, enter 6 in Months and 2 in Weeks. Result: Sunday, October 4, 2026.
Tips for Working with Date Calculations
Use "include end date" for rental and event periods. A hotel stay from March 1 to March 5 is 4 nights but 5 days if you count both arrival and departure dates. Check the box when you need inclusive day counts.
The order of dates does not matter for differences. Whether you enter the earlier or later date first, the "Days Between" result is always the same positive number.
Month addition clamps to valid dates. January 31 + 1 month = February 28 (not March 3). This matches how most legal and financial systems handle month-based calculations. Be aware of this when working with end-of-month dates.
Combine units for complex calculations. Need to find 1 year, 3 months, and 10 days from now? Enter all three values at once — the calculator handles the combination correctly, processing years first, then months, then days.
Use subtraction for "how long ago" questions. To find what date was 100 days before a specific event, enter the event date and subtract 100 days.
Frequently Asked Questions
Does "include end date" add a day to the result?
Does the calculator account for leap years?
What happens when I add 1 month to January 31?
Can I add years, months, and days at the same time?
Why are months and years shown as approximate in the difference result?
What is the difference between this and an age calculator?
Related Calculators
Age Calculator
Free age calculator. Enter your birth date to find your exact age...
Time Calculator
Free time calculator. Add or subtract hours, minutes, and seconds...
Time Duration Calculator
Free time duration calculator. Enter a start and end time to find...
Random Number Generator
Free random number generator. Generate one or multiple random int...