calculators.dev

Days Until a Date Calculator

Count the days until a target date. The 'from' date starts at today, so by default you get a live countdown to the date you choose. A target in the past simply reads as a negative count — 'X days ago' — so the calculator never errors and never shows a broken value.

Calculate

Default result: 187

Defaults to today. Change it to count from a different starting date.

Result

187

Days until

187 days from now
187

How to calculate

Pick a target date. The 'from' date defaults to today, but you can change it to count from any other starting date. The countdown updates as you type.

daysUntil = targetDay − fromDay, counted in whole calendar days. A positive result means the target is in the future ('N days from now'); zero means the target is the from date ('today'); a negative result means the target has already passed ('N days ago').
Example calculation

From June 21, 2026 to December 25, 2026 there are 187 days, so the target is 187 days from now. If the target were in the past, the count would be negative and read as 'X days ago' instead.

daysUntil
187 days
phrase
187 days from now

Assumptions

  • The count is the number of whole calendar days between the two dates. The from date itself is day 0, so a target one day later is '1 day from now'.
  • A target on the same day as the from date is 0 days — 'today'.
  • A target in the past gives a negative count and reads as 'X days ago'; it is never treated as an error.
  • The 'from' date defaults to today, where 'today' is your device's local calendar date. Around midnight your local date and the UTC date can differ by a day, so the countdown may shift by one near midnight depending on your time zone.
  • When you open a shared link the inputs come from the URL first, then from your last-used values saved in this browser, then from the calculator's defaults (which is why a shared link or a saved value can override 'today').

Common mistakes

  • Expecting a past date to throw an error. Instead it returns a negative count and reads as 'X days ago' — the calculator is designed to handle both directions.
  • Counting the from date as day 1. The from date is day 0, so the day immediately after it is '1 day from now'.

Frequently asked questions

What happens if the target date is in the past?

The count becomes negative and the calculator reads it as 'X days ago'. A past date is never an error — it just counts in the other direction.

Does today count as a day?

The from date is day 0. A target on the same day reads as 'today' (0 days), and the next day reads as '1 day from now'.

Can I count from a date other than today?

Yes. The from date defaults to today, but you can set it to any starting date to count the days between that date and your target.

Why might the countdown change by a day around midnight?

The 'today' value uses your device's local calendar date. Near midnight the local date and the UTC date can differ for a few hours, which can shift the countdown by one day.