Everyday Life

Time until calculator

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.


Use as default values for the embed calculator what is currently in input fields of the calculator on the page.


Input border focus color, switchbox checked color, select item hover color etc.


Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is a time until calculator?

A time until calculator tells you how much time separates the present moment, or any starting point you choose, from a future date and time. Instead of returning a single dry number, it expresses the remaining span in natural language, combining years, months, weeks, days, hours, minutes, and seconds into one readable phrase such as “2 months, 1 week and 3 days”.

This makes it ideal for tracking anything you are looking forward to: a wedding, an exam, a flight, the end of a subscription, a product release, or the next public holiday. Because the start defaults to right now, the figure stays meaningful the instant you read it, and you can always supply a custom start date and time to measure the gap between two specific moments.

How does the calculator work?

The calculator first measures the raw interval between the two moments as a number of seconds. It then decomposes that total from the largest unit to the smallest: it removes as many whole years as fit, then whole months from what remains, then weeks, days, hours, minutes, and finally the leftover seconds. Any unit that comes out to zero is simply left out of the final phrase, so a short span reads as “45 minutes” rather than “0 years, 0 months … 45 minutes”.

The order of the two moments does not matter. If the target is earlier than the start, the calculator reports the absolute size of the interval, so it works equally well as a “time since” counter for events in the past.

Formula

The starting point is the raw difference between the two instants, measured in seconds:

S=TtargetTstartS = \lvert\, T_{\text{target}} - T_{\text{start}} \,\rvert

The total is then split into units using average unit lengths. Each unit is the whole-number quotient of the remaining seconds, and the remainder is carried down to the next unit:

years=S31,557,600\text{years} = \left\lfloor \frac{S}{31{,}557{,}600} \right\rfloor

months=Smod31,557,6002,629,800\text{months} = \left\lfloor \frac{S \bmod 31{,}557{,}600}{2{,}629{,}800} \right\rfloor

days=Smod2,629,80086,400\text{days} = \left\lfloor \frac{S \bmod 2{,}629{,}800}{86{,}400} \right\rfloor

Where:

  • SS is the absolute interval in seconds.
  • A year is taken as 365.25365.25 days (31,557,60031{,}557{,}600 seconds) and a month as 30.437530.4375 days (2,629,8002{,}629{,}800 seconds), so the breakdown is stable regardless of which calendar months the interval spans.

Examples

Example 1: One full day ahead

Suppose the start is January 1, 2020 at 00:00:00 and the target is January 2, 2020 at 00:00:00.

S=Jan 2, 2020 00:00:00Jan 1, 2020 00:00:00=86,400 sS = \lvert\, \text{Jan 2, 2020 00:00:00} - \text{Jan 1, 2020 00:00:00} \,\rvert = 86{,}400 \text{ s}

The interval is exactly 86,400 seconds, which the calculator reports as 1 day.

Example 2: A few hours, minutes and seconds

Now set the start to January 1, 2020 at 00:00:00 and the target to the same day at 01:30:45.

S=1×3600+30×60+45=5,445 sS = 1 \times 3600 + 30 \times 60 + 45 = 5{,}445 \text{ s}

The breakdown removes one whole hour, then thirty minutes, leaving forty-five seconds, so the result reads “1 hour, 30 minutes and 45 seconds”.

Example 3: A full leap year

Consider a start of January 1, 2020 at 00:00:00 and a target of January 1, 2021 at 00:00:00. Because 2020 is a leap year, the span is 366 days.

S=366×86,400=31,622,400 sS = 366 \times 86{,}400 = 31{,}622{,}400 \text{ s}

Dividing by the average year length leaves a small remainder, so the phrase shows one year plus a few extra days rather than a bare “1 year”.

Practical notes

  • The start field defaults to the current date and time, so leaving it untouched gives you a live “how long until” figure.
  • Zero-valued units are dropped automatically, keeping the result short and readable.
  • Because months and years use average lengths, very long spans may differ by a day or two from a strict calendar count; for an exact day count between two dates, a dedicated day counter is the better tool.

Frequently asked questions (FAQs)

What start time does the calculator use by default?

By default the calculation begins at the current date and time, so the remaining span reflects the moment you open the tool. You can replace this with any custom start date and time.

Does the order of the two dates matter?

No. The calculator always reports the absolute size of the interval, so swapping the start and target produces the same result. This lets it act as both a “time until” and a “time since” counter.

Why does a one-year span sometimes show extra days?

Years and months are computed using average lengths (365.25 and 30.4375 days). A leap year contains 366 days, slightly more than the average, so the breakdown shows the surplus as additional days.

What happens to units that are zero?

Any unit that works out to zero is omitted from the phrase, so a short interval reads as “45 minutes” instead of listing empty years, months, and days.

Can it count down to a time on the same day?

Yes. If the start and target fall on the same calendar day, the result is expressed purely in hours, minutes, and seconds.

Report a bug

This field is required.