Date Calculator

How It Works

A date calculator helps you answer two types of date-related questions: how many days are between two dates, and what date you land on after adding or subtracting a period of time. These are surprisingly common calculations — and surprisingly easy to get wrong when doing them manually across month boundaries or leap years.

The Days Between Dates mode is useful for counting down to an event, measuring how long a project took, calculating age in days, or determining billing periods. Enter a start date and end date, and the result shows the total number of days along with a breakdown into months, weeks, and remaining days.

The Add / Subtract from Date mode answers questions like: What date is 90 days from today? What was the date 6 months ago? When is my 1-year anniversary? Choose a starting date, select the direction (add or subtract), enter a quantity, and choose the unit — days, weeks, months, or years. Common use cases include:

  • Project planning — add sprint durations to find delivery dates
  • Pregnancy tracking — add 280 days (40 weeks) to find estimated due date
  • Contract deadlines — add 30, 60, or 90 days to a signing date
  • Event countdowns — subtract today from a future event date
  • Age calculations — subtract a birthdate from today for exact days lived

Both modes handle leap years automatically — February 29 is treated correctly whether the year is a leap year or not.

How Date Calculations Work

Computers represent dates internally as a number of milliseconds since a fixed reference point (January 1, 1970 at midnight UTC). This makes finding the difference between two dates straightforward: subtract one timestamp from the other and convert the result to days.

Days = (End Date − Start Date) ÷ (1000 × 60 × 60 × 24)

The divisor converts milliseconds to days: 1,000 ms/sec × 60 sec/min × 60 min/hr × 24 hr/day = 86,400,000 ms per day.

Worked Example: Days Between Dates

Start Date: January 1, 2026

End Date: April 12, 2026


January: 31 days − 1 = 30 remaining

February: 28 days (2026 is not a leap year)

March: 31 days

April: 12 days

Total = 101 days (3 months, 11 days)

Month Addition and End-of-Month Handling

Adding months to a date near the end of a month requires special handling. For example, adding 1 month to January 31 cannot produce February 31 (which does not exist). Our calculator clamps the result to the last valid day of the target month — so January 31 + 1 month = February 28 (or February 29 in a leap year). This matches the behavior of most calendar applications and is the most intuitive result for scheduling purposes.

Frequently Asked Questions

Related Tools

Date Calculation Answers at a Glance

How do you calculate the number of days between two dates?

The number of days between two dates is calculated by subtracting the earlier date from the later date and converting the difference from milliseconds to whole days. This method accounts for varying month lengths and leap years automatically. For example, January 1 to April 12 is 101 days — counting 30 remaining days in January, 28 in February, 31 in March, and 12 in April.

What date is 90 days from today?

To find a date 90 days from today, add 90 calendar days to the current date, accounting for different month lengths and leap years. Use the “Add / Subtract from Date” mode of our calculator — select today's date, choose “Add,” enter 90, and select “Days” to get the exact result instantly.

How do leap years affect date calculations?

Leap years add an extra day (February 29) every four years, which means any date range crossing February in a leap year includes one additional day compared to a non-leap year. A year is a leap year if divisible by 4, except century years must be divisible by 400. Our calculator handles this automatically using timestamp-based arithmetic.

What happens when you add 1 month to January 31?

Adding 1 month to January 31 results in February 28 (or February 29 in a leap year), because February does not have 31 days. This is called end-of-month clamping — the result is adjusted to the last valid day of the target month. The same logic applies to other month-end dates like March 31 + 1 month = April 30.

How We Calculate This

Date difference calculations convert both dates to timestamps (milliseconds since January 1, 1970 UTC) and compute the arithmetic difference:

Days = (End Date − Start Date) ÷ 86,400,000

  • End Date / Start Date = Timestamps in milliseconds
  • 86,400,000 = Milliseconds per day (1000 × 60 × 60 × 24)
  • Days = Whole calendar days between the two dates

For “Add / Subtract” mode, the calculator uses native date arithmetic with end-of-month clamping to handle months and years correctly.

Common Use Cases

  • Calculate days until a deadline or event — find the exact number of days between today and a wedding, graduation, vacation, or project due date
  • Find a contract or warranty expiration date — add 30, 60, 90 days or 1–2 years to a start date to determine when an agreement expires
  • Track pregnancy due dates and milestones — add 280 days (40 weeks) to a last menstrual period date for an estimated due date
  • Plan project timelines and sprint deadlines — add weeks or months to a kickoff date to map out delivery milestones