Date Calculator
Days Between Two Dates
Add / Subtract Days from a Date
How Date Calculations Work
A date calculator performs two types of operations: finding the difference between two dates (subtraction), and finding a resulting date by adding or subtracting a number of days from a known date (addition). Both operations are built on the same foundation — converting calendar dates to a single integer representing the number of days elapsed since a reference point (called an epoch), doing arithmetic, then converting back.
Modern computers use the Unix epoch (January 1, 1970, midnight UTC) as the reference point for dates. Each date is stored as the number of milliseconds since that moment. To find the difference between two dates, you subtract their epoch values and convert milliseconds back to days: 1 day = 86,400 seconds = 86,400,000 milliseconds.
Days Between Dates — Worked Examples
How many days between January 15 and March 20 in a non-leap year?
How many days from April 5, 2025 to September 1, 2025?
Adding and Subtracting Days — Worked Example
What date is 90 days after March 1, 2025?
Common Uses for Date Calculators
Lease and contract terms. When a 12-month lease starts on March 15, it ends on March 14 of the following year (not March 15). Counting exactly 365 or 366 days (in a leap year) determines the end date. The date calculator handles this precisely, including leap year adjustments.
Pregnancy due dates. The standard gestational age is 280 days (40 weeks) from the last menstrual period (LMP). Adding 280 days to the LMP date gives the estimated due date. Our Due Date Calculator uses this calculation with additional trimester information.
Loan interest calculations. Many loan agreements charge interest on an exact-day basis rather than by calendar month. Knowing the exact number of days between the disbursement date and the repayment date is necessary for accurate interest computation, especially for short-term or bridge loans.
Project deadlines. When a project has a 45-business-day deadline from a kick-off date, you need to count only working days. For calendar-day deadlines, the date calculator gives an exact end date by adding the specified number of days.
Age verification. Verifying whether someone has reached a minimum age (18, 21, etc.) on a specific date requires calculating the exact difference between their birth date and the reference date. See our Age Calculator for a full breakdown including years, months, days, and next birthday countdown.
Leap Year Handling
A leap year has 366 days instead of 365. A year is a leap year if it is divisible by 4, except century years (1900, 2100), which must be divisible by 400 (so 2000 was a leap year but 1900 was not). The date calculator handles leap years automatically in all calculations.
Leap year matters most when: (1) you add exactly one year to a date — one year from February 29 is ambiguous (there is no February 29 in most years); conventions differ, but March 1 is the most common resolution. (2) you calculate the number of calendar days in an annual period — a year spanning February will either have 365 or 366 days.
Frequently Asked Questions
How do I calculate the number of days between two dates?
Subtract the earlier date from the later date. In mathematical terms, convert both dates to a serial number (days since a fixed epoch, such as January 1, 1970 in Unix time), then subtract. The result is the number of days difference. Both the start and end date are on the same clock time (midnight), so the result excludes fractional days. For example, from January 1 to January 31 is exactly 30 days (not 31, because you start counting from day 0 on January 1).
Does this calculator include the start date in the count?
No. The calculator counts the number of full days elapsed between the start date and end date. January 1 to January 5 = 4 days elapsed. If you need to count both the start and end day (inclusive), add 1 to the result. This inclusive counting is common in legal contexts, like lease agreements or project timelines, where Day 1 is the first day of the contract.
How are months calculated in the date difference result?
The months calculation is an approximation. The calculator steps forward month by month from the start date, then counts the remaining days. Because months have different lengths (28, 29, 30, or 31 days), the same number of days can correspond to a slightly different number of months depending on which months they span. For precise legal or financial purposes (like calculating interest over months), always use the exact day count rather than the approximate month count.
What is the furthest date this calculator can handle?
This calculator uses JavaScript's built-in Date object, which can handle dates from approximately 271,821 BCE to 275,760 CE. For practical purposes, date inputs are limited by the HTML date input field, which typically supports dates from 0001-01-01 to 9999-12-31. For everyday use — project planning, lease terms, pregnancy due dates, age calculations — you will never approach these limits.
How do I calculate the number of working days between two dates?
This calculator counts all calendar days including weekends and holidays. To count only business days (Monday-Friday), use our Working Days Calculator, which excludes weekends and optionally excludes public holidays for your country or region. For the US, UK, and India, common holiday calendars are preloaded.
Related Calculators
- Age Calculator — Exact age in years, months, and days with next birthday countdown
- Time Calculator — Add and subtract hours, minutes, and seconds
- Working Days Calculator — Exclude weekends and public holidays
- Due Date Calculator — Pregnancy due date from last menstrual period