Days Since and Until Calculator

Days Since and Until Calculator

Popular AI Skill PRO

Enter Calculation

Formula

Δ=⌊T−R86400000ms⌋where{T=date(Year,Month,Day)R=date(From Year,From Month,From Day)\begin{gathered} \Delta = \left\lfloor \frac{T - R}{86400000\ \text{ms}} \right\rfloor \\[1.5em] \text{where}\quad \left\{ \begin{aligned} T &= \text{date}\left(\text{Year},\ \text{Month},\ \text{Day}\right) \\ R &= \text{date}\left(\text{From Year},\ \text{From Month},\ \text{From Day}\right) \end{aligned} \right. \end{gathered}
Show calculation steps (1)
  1. Weeks Between

    Weeks=|Δ|7\text{Weeks} = \frac{\left| \Delta \right|}{7}

    Number of whole-and-fractional weeks between the two dates, using the absolute day difference.

Usage stats

Advertisement

Results

Days Since Target Date
327
days in the past
Signed difference (negative = past, positive = future) -327 days
In weeks 46.71 weeks
Direction Past

Report an error on this page

What this calculator does

The Days Since and Until Calculator tells you exactly how many days separate a target date from a reference date. If the target date is in the future you get a positive "days until" count; if it is in the past you get a negative "days since" count. It works for any pair of dates — birthdays, deadlines, anniversaries, contract dates, project milestones, or historical events. The tool is calendar-based and universal, so it applies anywhere in the world with no country-specific rules.

Timeline with a reference date in the center and arrows pointing left to past and right to future
Days since are counted to the left (past) and days until to the right (future) of the reference date.

How to use it

Enter the target date (the date you are counting toward or from) using the year, month, and day fields. Then enter the reference date — by default this is today, but you can set it to any date to compare two arbitrary dates. The calculator returns the absolute number of days, a signed difference (negative for the past, positive for the future), and the equivalent number of weeks.

The formula explained

Each date is converted to a midnight timestamp in milliseconds. The difference between the two timestamps is divided by 86,400,000 (the number of milliseconds in one 24-hour day) and floored to a whole number:

$$\Delta = \left\lfloor \frac{\text{Target Date} - \text{Reference Date}}{86400000\ \text{ms}} \right\rfloor$$

Because both dates are pinned to midnight, the result is the clean count of whole calendar days between them.

Advertisement
Subtraction of two dates divided by milliseconds in a day to get whole days
The difference in milliseconds between two dates divided by 86,400,000 gives whole days.

Worked example

Reference date: 1 January 2025. Target date: 31 January 2025. The difference is 30 days in the future, equal to about 4.29 weeks. If you swapped the dates — reference 31 January, target 1 January — the signed result would be −30 days (in the past), while the absolute count stays at 30 days.

$$\text{Weeks} = \frac{\left| \Delta \right|}{7} = \frac{30}{7} \approx 4.29$$

Days to Weeks, Months and Years Conversion Reference

Use this table to translate a day count into larger units. Weeks are exact because a week is always 7 days. Months and years are approximations: the table uses an average month of 30.44 days and an average year of 365.25 days (which accounts for leap years). Real calendar months run from 28 to 31 days and years from 365 to 366 days, so a result in months or years can differ slightly from a true calendar count.

Days Weeks (days ÷ 7) Months (days ÷ 30.44) Years (days ÷ 365.25)
7 1 0.23 0.019
14 2 0.46 0.038
30 4.29 0.99 0.082
60 8.57 1.97 0.164
90 12.86 2.96 0.246
180 25.71 5.91 0.493
365 52.14 11.99 0.999
366 52.29 12.02 1.002
730 104.29 23.98 1.999

Example: 90 days is \(90 \div 7 \approx 12.86\) weeks, or \(90 \div 30.44 \approx 2.96\) months. Values are rounded to the precision shown.

Common Date Gap Scenarios Compared

The signed difference is the target date minus the reference date: positive when the target is in the future relative to the reference, negative when it is in the past. The absolute difference ignores the sign. These counts are exclusive, meaning the reference day itself is not counted. Dates use the Gregorian calendar.

Reference date Target date Signed days Absolute days Weeks (absolute ÷ 7)
1 Jan 2025 1 Jan 2025 0 0 0
1 Jan 2025 31 Jan 2025 +30 30 4.29
31 Jan 2025 1 Jan 2025 -30 30 4.29
28 Feb 2024 1 Mar 2024 +2 (leap year, 29 Feb exists) 2 0.29
28 Feb 2025 1 Mar 2025 +1 (no 29 Feb) 1 0.14
1 Jan 2025 31 Dec 2025 +364 364 52
1 Jan 2024 1 Jan 2025 +366 (2024 is a leap year) 366 52.29

Takeaway: the same calendar span can differ by one day depending on whether a leap day falls inside it, and swapping the two dates only flips the sign.

Advertisement

Key Terms: Days Since, Days Until and Signed Difference

Target date
The date you want to measure to or from, such as a deadline, birthday, event or past milestone.
Reference date
The starting point of the comparison, often today's date. The result tells you how far the target date is from this date.
Signed difference
The target date minus the reference date, in days. A positive value means the target is in the future (days until); a negative value means it is in the past (days since); zero means the dates are the same.
Absolute difference
The size of the gap without its sign. For example, +30 and -30 both have an absolute difference of 30 days.
Exclusive vs inclusive counting
Exclusive counting does not count the starting day, so 1 Jan to 2 Jan is 1 day. Inclusive counting counts both the first and last day, so add 1: 1 Jan to 2 Jan inclusive is 2 days. This calculator gives the exclusive difference; add 1 if you need an inclusive count.
Calendar day
A full day from midnight to midnight on the calendar. Counting calendar days ignores hours and minutes, and the formula divides the time difference by 86,400,000 milliseconds (one day) to get a whole number of days.
Leap year
In the Gregorian calendar, a year with an extra day, 29 February. Leap years are years divisible by 4, except century years that are not divisible by 400. So 2024 and 2000 are leap years, while 2025 and 1900 are not. A leap year has 366 days instead of 365.

FAQ

Does it count today? The difference is exclusive of the start date: from today to tomorrow is 1 day. Same-date inputs return 0.

Does it handle leap years? Yes. The calendar engine accounts for February 29 automatically.

Can the reference date be in the future? Absolutely — you can compare any two dates in either direction; the sign tells you which way.

Last updated:

Most popular in Time and Date

View all Time and Date calculators