CatalogTools ›Calculators

Days Between Dates — calculate the exact interval

How many days are left until an event, or how many have passed since an important date? Enter two dates and get the exact difference in days — handy for countdowns, deadlines or anniversaries. Every calculation stays saved, so you can keep track of more than one at a time without redoing it.

▶ Use this app

daysdatescountdowncalculator

What it records

  • What you're counting, e.g. Wedding countdown

How it works

This is a Reactive app: a plain text document that your browser turns into a working app — forms, live data, tables, statistics and even charts, with nothing to install or configure.

  1. Use it right away. Hit “Use this app”: it opens right in your browser, ready to go, with data saved only on your device.
  2. Your data stays yours. Everything is stored locally on your device, kept separate for each app: no account, no server, nothing to set up.
  3. Make it your own. The text below is the entire app: copy it, tweak fields, views and words, and your changes become interactive instantly.
  4. Share it as a file. An app is a simple file: save it, export it or share it with a link; and with encrypted collaboration several people edit the same data in real time.
The app’s source
# 📅 Days Between Dates

How many days are left until an event, or how many have passed since an
important date? Enter two dates and get the exact difference in days —
handy for countdowns, deadlines or anniversaries. Every calculation stays
saved, so you can keep track of more than one at a time without redoing it.

::::form{path="spans" id="fin"}
::input{form="fin" field="label" placeholder="What you're counting, e.g. Wedding countdown"}
::input{form="fin" field="from" type="date" required="true" legend="From"}
::input{form="fin" field="to" type="date" required="true" legend="To"}
::add-form{form="fin" path="spans" label="Calculate"}
::::

:::python{data="spans"}
```
from datetime import date

rows = data["spans"]
for r in rows:
    start = date.fromisoformat(r["from"])
    end = date.fromisoformat(r["to"])
    days = (end - start).days
    note = " (in the past)" if days < 0 else ""
    print(f"{r['label']}: {days} days{note}")
```
:::

## History

:::table{path="spans" headers="What,From,To" deletable="true" editform="fin"}
{label} | {from} | {to}
:::

Every row stays saved on your device: come back anytime to update the
countdown or check the dates you've already calculated.