About the days-between-dates calculator
The days-between-dates calculator measures the exact span between any two calendar dates and reports it five ways at once: days, weeks, months, years, and hours. It is the standard helper for visa overstay tracking, lease and loan period calculations, project deadline planning, statute-of-limitations checks, anniversary countdowns, and any contract that bills, charges, or accrues by elapsed time. Anyone who has ever argued with a HR system about how many days of notice were actually served, or a landlord about how many days a deposit was held, knows that the dispute almost always hinges on whether the end date is counted inclusively.
The tool defaults to the exclusive count (the bare time elapsed, like a stopwatch). For contract and statutory uses you may need to add one day to capture inclusive counting; the table below makes the convention explicit so you do not silently lose a day in either direction.
How the calculation works
JavaScript Date objects store time as milliseconds since 1970-01-01 UTC. Subtracting two Date timestamps gives the difference in milliseconds, which the tool then converts to days, weeks, months, years, and hours. Months and years use the average-length conventions (30.44 and 365.25 days respectively) because actual months have 28, 29, 30, or 31 days and the average smooths leap years.
days = (end_ms - start_ms) / 86,400,000 weeks = days / 7 months = days / 30.44 // 365.25 / 12 years = days / 365.25 // Julian year, averages leap years hours = (end_ms - start_ms) / 3,600,000
- UTC parsing: both dates are read as midnight UTC, so DST shifts and timezone parsing do not skew the result.
- Exclusive count by default: 1 Jan to 8 Jan is 7 days, not 8. Add one day for inclusive counts (rent days, lease days, statutory clocks).
- Absolute output: the displayed days are always positive; the calculator does not flip if you reverse start and end.
- Decimal precision: weeks, months, and years carry one or two decimal places so the residual is not lost.
Worked example
You signed a 24-month rental lease on 2024-01-01 and want to know exactly how many days you have lived in the unit as of 2026-05-08.
- Start: 2024-01-01 (Jan 1 = day 1 of the lease).
- End: 2026-05-08 (today).
- Days: 858 days.
- Weeks: 122.6 weeks.
- Months: 28.2 (the 24-month lease has already ended, you are 4 months into month-to-month).
- Years: 2.35.
- Hours: 20,592.
Common duration thresholds
| Context | Duration that triggers a rule | Reference |
|---|---|---|
| US substantial presence test | 183 days weighted (current + 1/3 prior + 1/6 two years prior) | IRS Pub 519 |
| Indian tax residence | 182 days in FY, or 60 days + 365 days in prior 4 years | Income Tax Act, Sec 6 |
| UK statutory residence | Automatic resident at 183 days | HMRC RDR3 |
| US tourist visa (B-2) | Up to 180 days per visit | USCIS I-94 |
| Schengen visa | 90 days in any 180-day window | EU regulation 539/2001 |
| Notice period (white-collar, India) | Typically 60 to 90 days | Employment contracts |
| Probation period | Typically 90 to 180 days | Employer policy |
| Statute of limitations (small claims, India) | 3 years from cause of action | Limitation Act 1963 |
Common pitfalls
- Inclusive vs exclusive counting. Most contracts and visa rules count the start day as day 1, meaning you should add one to the exclusive answer this tool returns. Lease language sometimes does the opposite. Check before you act.
- Daylight saving days are not 24 hours. The day a DST shift happens is 23 or 25 hours in local time. The tool uses UTC so this never moves the day count.
- Month length matters for short spans. Saying "about 1 month" for the gap from 1 February to 1 March (28 or 29 days) versus 1 March to 1 April (31 days) hides up to 3 days of difference, which matters for interest accrual.
- Leap year edge cases. Year 2000 was a leap year (divisible by 400), 2100 will not be (divisible by 100 but not 400). Long-range duration calculations should test against the actual rule, not just "divisible by 4".
- Off-by-one with Mondays. Counting "business days" requires subtracting weekends and holidays from raw days. This tool returns raw calendar days; use a business-day tool for working-day counts.
- Time zone for the start date. An e-commerce order placed at 11:59 PM PT will show as the next day for an EST recipient. For legal contracts, fix the timezone in the document.
Related calculators on 3Tej
Frequently asked questions
Why are my contract days different from the calculator's answer?
Almost always because of inclusive versus exclusive counting. This tool returns the bare elapsed days, like a stopwatch: 1 January to 8 January is 7. Contracts and statutes often count the start day as day 1, making the same range 8 days. Read the document's "computation of time" clause or add one day.
Is 2100 a leap year?
No. A year is a leap year if it is divisible by 4, except centuries that are not divisible by 400. 2000 was a leap year (divisible by 400). 2100, 2200, and 2300 are not. 2400 will be. The rule corrects for the 11-minute-per-year drift of the Julian calendar.
How do I count business days only?
Subtract weekends and public holidays from the raw day count. For most weeks, multiply the number of complete weeks by 5 and add the weekday remainder. Country-specific holiday calendars (e.g., India NSE, US SIFMA, UK Bank Holidays) must be applied. Use a dedicated business-days calculator for that.
Why does India use UTC+5:30 instead of a whole-hour offset?
India spans about 30 degrees of longitude (roughly 3,000 km), straddling two time zones. In 1906 the British colonial administration chose a single offset midway between UTC+5 and UTC+6 to avoid splitting the country in two. The half-hour offset has stuck. Nepal (UTC+5:45) and parts of Australia have similar partial-hour offsets.
What is the difference between UTC and GMT?
GMT (Greenwich Mean Time) was based on the apparent position of the sun at the Royal Observatory in Greenwich, London. UTC (Coordinated Universal Time) is defined by an ensemble of atomic clocks and is the modern civil-time standard. They differ by less than one second; for everyday use they are interchangeable. Aviation, GPS, and Internet timestamps all use UTC.
Time, calendars, and what the world actually agrees on
The Gregorian calendar (the one most of the world uses for civil dates) was introduced by Pope Gregory XIII in 1582 to fix the 11-minute-per-year drift of the Julian calendar. It cycles every 400 years. A year is a leap year if divisible by 4, except centuries unless they are divisible by 400.
Time zones and offsets
| Zone | UTC offset | Notes |
|---|---|---|
| UTC / GMT | +00:00 | Universal reference; UK in winter |
| EST / EDT (US East) | -05:00 / -04:00 | DST observed; NYC, Toronto |
| PST / PDT (US West) | -08:00 / -07:00 | DST observed; LA, Vancouver |
| IST (India) | +05:30 | No DST; covers 3,000 km E-W |
| JST (Japan) | +09:00 | No DST |
| AEDT / AEST (Sydney) | +11:00 / +10:00 | DST observed in NSW, VIC, ACT, TAS |
| CET / CEST (Europe) | +01:00 / +02:00 | DST observed; Berlin, Paris, Rome |
Daylight Saving Time gotchas
- DST start: clocks jump forward; the 02:00-03:00 hour disappears. Schedules at 02:30 run once or not at all.
- DST end: clocks fall back; 01:00-02:00 happens twice. Schedules at 01:30 run twice.
- ~40% of the world's countries don't observe DST: India, China, Japan, most of Africa, most of Asia.
- The EU passed a directive in 2019 to abolish DST but never finalized member-state choices. Still in effect as of 2026.
How long is a year really?
- Tropical year (sun position): 365.2422 days
- Sidereal year (star position): 365.2564 days
- Gregorian average: 365.2425 days (97 leap years per 400)
- Difference from tropical: ~26 seconds per year, drifts ~1 day every 3,300 years
ISO 8601 - the unambiguous date format
Use YYYY-MM-DD everywhere. It's unambiguous (no US vs UK confusion), sorts correctly as a string, and is the JSON / API standard.
- Date only:
2026-05-13 - Date + time UTC:
2026-05-13T14:30:00Z - Date + time with offset:
2026-05-13T19:30:00+05:30(IST) - Duration:
P1Y2M3DT4H5M6S(1 year, 2 months, 3 days, 4 hours, 5 minutes, 6 seconds) - Week date:
2026-W20-3(ISO week 20, Wednesday)
