Days Between Two Dates Calculator

Days Between Two Dates Calculator

Popular AI Skill PRO

Enter Calculation

Formula

Δ=JDN(Ye,Me,De)−JDN(Ys,Ms,Ds)+First Daywhere{Ys=Start Era+Start Year,Ms=Start Month,Ds=Start DayYe=End Era+End Year,Me=End Month,De=End Day\begin{gathered} \Delta = \text{JDN}(Y_e,M_e,D_e) - \text{JDN}(Y_s,M_s,D_s) + \text{First Day} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} Y_s &= \text{Start Era} + \text{Start Year},\; M_s = \text{Start Month},\; D_s = \text{Start Day} \\ Y_e &= \text{End Era} + \text{End Year},\; M_e = \text{End Month},\; D_e = \text{End Day} \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

Total elapsed days
3,652
days
Weeks 521 weeks + 5 days
Months 120 months + 0 days
Years 10 years + 0 days
Years / Months / Days 10 years + 0 months + 0 days

Report an error on this page

What this calculator does

This tool measures the elapsed time between a start date and an end date and shows it five ways at once: total days; weeks plus leftover days; whole calendar months plus leftover days; whole years plus leftover days; and the conventional years-months-days breakdown. A typical use is finding exactly how many days you have lived since your birthday.

Timeline with a start date and end date marked, and the span of days between them highlighted
The calculator measures the span between a start date and an end date in days, weeks, months and years.

Jurisdiction note (Japan)

The calculation itself is universal date arithmetic and works for any country. Only the optional era dropdown is Japan-specific: choosing Meiji, Taisho, Showa, Heisei or Reiwa converts an era year into a Gregorian (CE) year by adding a fixed base offset (for example Reiwa 1 = \(2018 + 1 = 2019\)). The default and primary mode is the Western year (CE), where the value you type is the full CE year. Japanese-era input is only meaningful from Meiji 6 (1873), when Japan adopted the Gregorian calendar.

How to use it

Pick the calendar/era for each date (leave it on "CE (Western)" for ordinary use), enter the year, month and day for both the start and end date, and choose whether to count the first day. "Exclude" gives the plain difference; "Include" adds one day so both endpoints are counted.

Advertisement

The formula

Each date is converted to a Julian Day Number (JDN), a continuous count of days that is independent of month and year boundaries and handles leap years automatically. The total is JDN(end) minus JDN(start), optionally plus one. Weeks come from integer division by 7. Months and years use the anniversary method: a calendar month is only counted once the same day-of-month is reached, so the breakdown matches how people normally state ages and durations.

$$\begin{gathered} \Delta = \text{JDN}(Y_e,M_e,D_e) - \text{JDN}(Y_s,M_s,D_s) + \text{First Day} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} Y_s &= \text{Start Era} + \text{Start Year},\; M_s = \text{Start Month},\; D_s = \text{Start Day} \\ Y_e &= \text{End Era} + \text{End Year},\; M_e = \text{End Month},\; D_e = \text{End Day} \end{aligned} \right. \end{gathered}$$
Diagram showing two dates converted to Julian Day Numbers and subtracted to get the day difference
Each date is converted to a Julian Day Number; subtracting them gives the number of days between.

Worked example

Start 2000-06-15, end 2010-06-20, first day excluded. \(\text{JDN(start)}=2451711\), \(\text{JDN(end)}=2455368\), so days:

$$\text{days} = 2455368 - 2451711 = 3657$$

Weeks = 522 with 3 remaining days. Months = 120 with 5 remaining days. Years = 10 with 5 remaining days. Years-months-days = 10 years, 0 months, 5 days.

Japanese Era to Gregorian Year Conversion Table

The era (nengō) system below is specific to Japan: it is the official year-numbering used on Japanese documents alongside the Gregorian (CE) year, and it has no equivalent in other countries. This calculator converts an era year to a CE year by simple addition of a fixed base offset:

$$Y_{\text{CE}} = \text{base offset} + \text{era year}$$

Era Base offset First CE year Last CE year Era start date (CE) Era end date (CE) Max valid era year Worked conversion
Meiji (明治) +1867 1868 1912 1868-10-23 1912-07-30 Meiji 45 Meiji 40 = 1867 + 40 = 1907
Taishō (大正) +1911 1912 1926 1912-07-30 1926-12-25 Taishō 15 Taishō 10 = 1911 + 10 = 1921
Shōwa (昭和) +1925 1926 1989 1926-12-25 1989-01-07 Shōwa 64 Shōwa 50 = 1925 + 50 = 1975
Heisei (平成) +1988 1989 2019 1989-01-08 2019-04-30 Heisei 31 Heisei 20 = 1988 + 20 = 2008
Reiwa (令和) +2018 2019 current 2019-05-01 — open-ended (Reiwa 8 = 2026) Reiwa 8 = 2018 + 8 = 2026

Two things to watch when entering an era year

  1. Transition years overlap. A new era begins mid-year, so one CE year carries two era names. 1912 is both Meiji 45 (up to 30 July) and Taishō 1 (from 30 July); 1926 is Taishō 15 then Shōwa 1 (from 25 December); 1989 is Shōwa 64 (1–7 January) then Heisei 1 (from 8 January); 2019 is Heisei 31 (to 30 April) then Reiwa 1 (from 1 May). The offset arithmetic gives the right CE year for either name, but the month and day decide which era label is historically correct — e.g. Shōwa 64-03-15 does not exist, because Shōwa ended on 7 January 1989.
  2. Era input is only meaningful from Meiji 6 (1873). Japan switched from a lunisolar calendar to the Gregorian calendar by replacing Meiji 5-12-03 with Meiji 6-01-01, i.e. 1 January 1873. Dates in Meiji 1–5 are lunisolar dates whose month and day numbers do not line up with Gregorian months, so a Julian-Day-Number difference computed from them would be wrong. Enter dates from Meiji 6 onward (or use the Western/CE option for earlier dates).

For reference, the era years that matter most in practice today: Shōwa 1–64 (1926–1989), Heisei 1–31 (1989–2019), Reiwa 1 onward (2019–).

Advertisement

More Worked Examples

All three examples use the same two-step method: convert each date to its Julian Day Number (a single running day count, so no month-length or leap-year special cases are needed), then subtract. The optional Include first day switch adds 1 to the raw difference.

$$\Delta = \text{JDN}(Y_e,M_e,D_e) - \text{JDN}(Y_s,M_s,D_s) + \text{(1 if the first day is included, else 0)}$$

Example 1 — inclusive vs. exclusive counting: 1 March 2026 → 31 March 2026

This is the classic "how many days is my March campaign?" case, where the answer depends entirely on the counting convention.

  • \(\text{JDN}(2026,3,1) = 2{,}461{,}101\)
  • \(\text{JDN}(2026,3,31) = 2{,}461{,}131\)

Exclusive (default) — the gap between the dates:

$$\Delta = 2461131 - 2461101 = 30\ \text{days}$$

Inclusive (Include first day on) — 1 March itself is counted:

$$\Delta = 2461131 - 2461101 + 1 = 30 + 1 = $$ 31 days

Breakdown Exclusive (30 days) Inclusive (31 days)
Total days 30 31
Weeks + days 4 weeks 2 days (4 × 7 + 2) 4 weeks 3 days (4 × 7 + 3)
Months + days 0 months 30 days 1 month 0 days (1 Mar → 1 Apr spans 31 days)
Years / months / days 0 years 0 months 30 days 0 years 1 month 0 days

Rule of thumb: use the exclusive result for elapsed time (interest accrual, age, "days since"), and the inclusive result when every calendar day is itself a billable or countable unit (hotel-style day counts, leave days, event length).

Example 2 — Japanese era input: Shōwa 50-04-01 → Reiwa 8-10-02

Era years are converted to CE years before the JDN step, using the base offsets from the table above:

  • Start: Shōwa 50 → \(1925 + 50 = 1975\), so the date is 1975-04-01
  • End: Reiwa 8 → \(2018 + 8 = 2026\), so the date is 2026-10-02

Then:

  • \(\text{JDN}(1975,4,1) = 2{,}442{,}504\)
  • \(\text{JDN}(2026,10,2) = 2{,}461{,}316\)

$$\Delta = 2461316 - 2442504 = $$ 18,812 days

Breakdown Result How it is obtained
Total days 18,812 JDN difference
Weeks + days 2,687 weeks 3 days 2687 × 7 = 18,809; remainder 3
Months + days 618 months 1 day 51 × 12 + 6 = 618 complete months, then 1 Oct → 2 Oct
Years / months / days 51 years 6 months 1 day 1975-04-01 → 2026-04-01 (51 y) → 2026-10-01 (+6 m) → 2026-10-02 (+1 d)

Note the day count includes 13 leap days (1976, 1980, …, 2024), which is why \(51 \times 365 = 18{,}615\) alone would be 13 days short of the 18,628 days to 2026-04-01.

Example 3 — anniversary across a leap day: 29 February 2024 → 28 February 2025

  • \(\text{JDN}(2024,2,29) = 2{,}460{,}370\)
  • \(\text{JDN}(2025,2,28) = 2{,}460{,}735\)

$$\Delta = 2460735 - 2460370 = $$ 365 days

Breakdown Result
Total days 365
Weeks + days 52 weeks 1 day (52 × 7 + 1)
Months + days 11 months 30 days
Years / months / days 0 years 11 months 30 days

Why 365 days is not "1 year" here. The day count is unambiguous — 365 days, because 2024 is a leap year but its extra day (29 February 2024) is the start date itself, not inside the interval. The calendar breakdown is a different question: a whole month is only completed when the same day-of-month is reached again. Counting forward from 29 February 2024:

  1. +11 months lands on 29 January 2025 — eleven day-29s have been reached.
  2. The twelfth month would require 29 February 2025, which does not exist in a common year, so the twelfth month never completes.
  3. The leftover is counted in days: 29 January 2025 → 28 February 2025 is 30 days (2 days to the end of January plus 28 days of February).

Hence 0 years 11 months 30 days, and \(11 \times 30 + 30\) is only a coincidence — the 30 is a true day remainder, not an average month. Be aware that software and legal conventions differ on this point: some systems clamp 29 February to 28 February and would report "1 year", others roll forward to 1 March and would report "11 months 30 days" exactly as above. If a contract, insurance policy or statute depends on a leap-day anniversary, check which rule that document or jurisdiction specifies rather than assuming the calculator's convention.

FAQ

What if the end date is before the start date? The total-day figure becomes negative to show the direction, while the week/month/year breakdown is shown as an absolute duration.

Are leap years handled? Yes. Julian Day Numbers account for leap years and February 29 automatically.

Why are months and years not just days divided by 30 or 365? Because real months and years vary in length. This tool counts true calendar anniversaries, which is more accurate than a fixed average.

Last updated:

Most popular in Time and Date

View all Time and Date calculators