Days Until Date Calculator

Days Until Date Calculator

Leading AI Skill PRO

Enter Calculation

Formula

Days=⌊Target date−From date86400000⌋\text{Days} = \left\lfloor \frac{\text{Target date} - \text{From date}}{86400000} \right\rfloor
Usage stats

Advertisement

Results

Days Until Date
46
days from your start date
Days (absolute) 46
Weeks 6.57

Report an error on this page

What is the Days Until Date Calculator?

The Days Until Date Calculator tells you exactly how many days separate two dates — typically from today until a future event such as a birthday, wedding, exam, holiday, product launch, or project deadline. Enter a target date and, optionally, a custom start date, and the tool returns a precise day count plus the equivalent number of weeks.

Calendar showing a count of days between a start date and a target date
The calculator counts the whole days between today and your chosen target date.

How to use it

Pick your target date using the date picker. By default the countdown is measured from today; if you want to count from a different day, enter a from date. Press calculate and the result shows the signed number of days (negative if the target is in the past), the absolute number of days, and the number of weeks.

The formula explained

Each date is converted to a timestamp in milliseconds at midnight. The calculator subtracts the start timestamp from the target timestamp and divides by 86,400,000 — the number of milliseconds in one 24-hour day (1000 × 60 × 60 × 24). The result is rounded down with the floor function to give whole days:

$$\text{days} = \left\lfloor \frac{\text{target} - \text{from}}{86{,}400{,}000} \right\rfloor$$
Advertisement
Timeline showing the difference between two dates divided into days
Days equal the time difference between the two dates divided into 24-hour blocks.

Worked example

Suppose today is January 1, 2024 and your target date is January 31, 2024. The difference is 30 days, so the calculator returns 30 days (about 4.29 weeks). If the target were in the past, the day count would be negative while the "absolute" row still shows the magnitude.

Countdown Scenarios Compared

The calculator normalises both dates to midnight and subtracts them, so the result is always a whole number of calendar days: \(\text{Days} = \left\lfloor \frac{\text{Target date} - \text{From date}}{86400000} \right\rfloor\), where 86,400,000 is the number of milliseconds in a day. A positive value means the target is still ahead; zero means it is today; a negative value means the date has already passed. The examples below use fixed dates so you can reproduce every figure exactly.

From date Target date Days (signed) Absolute days Weeks (days ÷ 7) Note
2026-01-01 2026-12-25 358 358 51.14 New Year's Day to 25 December in the same common year
2026-09-17 2026-09-17 0 0 0.00 Same day — the countdown has reached zero
2026-09-17 2026-06-01 −108 108 15.43 Target already passed; the sign shows it is 108 days in the past
2028-02-01 2028-03-01 29 29 4.14 2028 is a leap year, so February has 29 days (28 in a common year)
2026-01-01 2027-01-01 365 365 52.14 One full common year — 2026 is not a leap year

Two useful checks: the difference between the same calendar date one year apart is 365 days in a common year and 366 days when the span contains 29 February; and any difference that is an exact multiple of 7 lands on the same weekday. For instance, 358 days is not a multiple of 7 (358 ÷ 7 = 51 remainder 1), so 25 December 2026 falls one weekday later in the week than 1 January 2026.

Converting Days to Weeks, Months and Years

Once you have a day count, you often want it expressed in larger units. Weeks are exact — a week is always 7 days. Months and years are not exact, because calendar months run from 28 to 31 days and years from 365 to 366 days. The standard averages come from the Gregorian calendar, which repeats every 400 years containing 146,097 days, giving an average year of \(146097 \div 400 = 365.2425\) days and an average month of \(365.2425 \div 12 = 30.436875\) days.

Unit Equals (days) Reverse conversion Exact or average?
1 week 7 weeks = days ÷ 7 Exact
1 fortnight 14 fortnights = days ÷ 14 Exact
1 month ≈ 30.44 (30.436875) months ≈ days ÷ 30.44 Average
1 quarter (3 months) ≈ 91.31 (91.310625) quarters ≈ days ÷ 91.31 Average
1 common year 365 years = days ÷ 365 Exact for a non-leap year
1 leap year 366 years = days ÷ 366 Exact for a leap year
1 average Gregorian year 365.2425 years ≈ days ÷ 365.2425 Average

Worked conversion for the 358-day countdown above:

$$\text{Weeks} = \frac{358}{7} = 51.14 \qquad \text{Months} \approx \frac{358}{30.436875} = 11.76 \qquad \text{Years} \approx \frac{358}{365.2425} = 0.98$$

Treat the month and year figures as approximations for communication ("just under 12 months"), not as calendar facts. The gap between 31 January and 28 February is 28 days and the gap between 31 March and 30 April is 30 days, yet both are "one month". The calculator itself never uses these averages — it subtracts the two real calendar dates, so its day count already accounts for every short month, long month and leap day in the span. The Gregorian calendar described here is the civil calendar used for international and business dating; countdowns tracked in other calendar systems, such as purely lunar ones, will not match these averages.

Advertisement

Key Terms Explained

  • Target date — the future (or past) date you are counting toward: a birthday, exam, deadline, wedding, holiday or launch. It is the minuend in the subtraction.
  • From date (start date) — the date you count from. It defaults to today, but you can set it to any date to measure the gap between two arbitrary dates.
  • Signed days — the raw result of target minus from. Positive means the target is in the future, 0 means it is today, and negative means it has already passed. The sign carries real information, so it is worth keeping.
  • Absolute days — the signed result with the minus sign removed, written \(|d|\). Use it when you only care about the size of the gap ("108 days apart"), not the direction.
  • Exclusive counting — the default here: the start day is not counted, so 1 January to 2 January is 1 day. This is the plain arithmetic difference between the two dates.
  • Inclusive counting — counting both endpoints, which gives one more: 1 January to 2 January is 2 days inclusive. Add 1 to the result when you need this, for example when counting how many days a hotel booking or a rental period covers.
  • Whole (full) day — a complete 24-hour block. Because the result is floored, 6 days and 23 hours is reported as 6 full days, not 7.
  • Unix timestamp / epoch milliseconds — the internal representation of a moment in time as the number of milliseconds elapsed since 1 January 1970, 00:00:00 UTC. Subtracting two timestamps gives an elapsed duration in milliseconds, which is why the formula divides by 86,400,000 (24 × 60 × 60 × 1000).
  • Floor function — \(\lfloor x \rfloor\) rounds down to the nearest integer: \(\lfloor 6.96 \rfloor = 6\). It guarantees the answer is a whole number of completed days rather than a fraction.
  • Leap year — a year of 366 days containing 29 February. In the Gregorian calendar a year is a leap year if it is divisible by 4, except century years, which must also be divisible by 400. So 2024 and 2028 are leap years, 2100 will not be, but 2000 was.
  • UTC vs local time — Coordinated Universal Time is the global reference; your local clock is UTC plus or minus a time-zone offset. The same instant can be two different calendar dates in two places, which is why a countdown should be computed on the calendar dates you actually mean rather than on raw timestamps from different zones.
  • Daylight saving time (DST) — the seasonal clock shift used in many, though not all, countries. On changeover days a local day lasts 23 or 25 hours, which can make a naive timestamp subtraction land at 6.958 or 7.042 days instead of 7. Normalising both dates to midnight before subtracting removes the hours-and-minutes component entirely, so the day count stays a clean integer no matter how many DST transitions or time-zone rules fall inside the span.

Conventions and edge cases

Each case below was run through this calculator; the result column is what it actually returns.

CaseInputResultNote
1 to 31 January2025-01-01 → 2025-01-3130 daysThe start date is not counted.
29 February to 28 February of a common year2000-02-29 → 2025-02-289131 days
Across 29 February 20242024-02-28 → 2024-03-012 days
End date before start date2025-03-31 → 2025-01-0189 daysShown as a positive span (order does not matter).
Same start and end date2025-03-10 → 2025-03-100 days

Checked on 2026-11-08

FAQ

Does it include the target day itself? No. The count is the number of full days between the two dates, so the target day is day zero. Add 1 if you want an inclusive count.

Why is my result negative? A negative value means the target date has already passed relative to your start date.

Does it handle leap years? Yes. Because the calculation uses real calendar timestamps, February 29 and varying month lengths are accounted for automatically.

Last updated:

Most popular in Time and Date

View all Time and Date calculators