ForHosting KIT · Health & fitness

Sobriety calculator

Enter the first day of your sobriety and today's date to see the time in whole years, months and days: from 15 January 2020 to 25 July 2026 is 6 years, 6 months and 10 days. Ready for a chip, card or check-in. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Sobriety date
2020-01-15
Current date
2026-07-25
You get
Years
6
Months
6
Days
10
Total days
2,383

A sobriety calculator answers a calendar question that people in recovery, sponsors, and wellness apps ask every day: given the day alcohol, drugs, or another substance last left the picture, how many whole years, months, and days have elapsed as of a chosen current date.

What elapsed sobriety means in civil years, months, and days

Elapsed sobriety is a civil-calendar span, not a stopwatch. People in recovery usually want the same breakdown a chip meeting uses: how many whole years, then leftover months, then leftover days, counted from the first calendar day of continuous sobriety to a chosen as-of day.

The civil breakdown adds calendar months from the start date, clamps the day when the destination month is shorter (so 31 January plus one month becomes the last day of February, including 29 February in a leap year), then walks the month count back if that clamped date overshoots the as-of day, and finally reports the remaining whole days.

Leap years follow the familiar four, one hundred, and four hundred rule, so a start on 29 February 2024 reaches 28 February 2025 as one year with the day clamped, and 1 March 2025 as one year and one day. Inclusive counting that would call that first calendar day 'one day sober' is a meeting convention, not this contract.

Recovery chips and anniversary cards

Enter the sobriety start and the ceremony date to print years, months, and days on a chip, card, or token without hand-counting February.

Sponsor check-ins and meeting shares

Compute a stable elapsed phrase for a check-in or share from the same start date and today's calendar day, including same-day zero spans.

What happens if my sobriety date is after the current date?

Elapsed sobriety is undefined when the start date is later than the as-of date, and that failure is not billed.

How are leap days such as 29 February handled?

Leap years follow the 4 / 100 / 400 Gregorian rule. Adding calendar months clamps to the last day of the destination month, so 29 February plus twelve months in a common year becomes 28 February.

Why does my first day show zero days?

Because the count is exclusive: when the start date and the as-of date are the same, the result is zero years, months and days. Some meetings count that first day as day one, so their number runs one higher.

Does it also show the total number of days?

Yes. Along with years, months and days you get the total of whole days between the two dates. From 15 January 2020 to 25 July 2026 that is 2383 days.

What happens when the next month is shorter?

The day moves back to the end of that month. A start on 31 January reaches one month on the last day of February, which is 29 February in a leap year.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/health/sobriety

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/health/sobriety \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sobriety_date":"2020-01-15","current_date":"2026-07-25"}'
{
  "sobriety_date": "2020-01-15",
  "current_date": "2026-07-25"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.sobriety",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Send two Gregorian calendar dates in YYYY-MM-DD form. sobriety_date is the start of continuous sobriety, and current_date is the as-of day because this engine never reads a wall clock. The response reports elapsed years, months, days, and the exclusive total_days count, plus a short elapsed phrase you can print on a chip or a card. If the sobriety date falls after the current date the task fails with invalid_input and is not billed.

What elapsed sobriety means in civil years, months, and days

This sobriety calculator treats both ends as Gregorian dates with no time-of-day, so a start of 2020-01-15 and an as-of day of 2026-07-25 is six years, six months, and ten days, with an exclusive total_days count of the whole civil days between those two midnights. Same-day input is a valid zero span: if sobriety_date equals current_date the engine returns zero years, zero months, zero days, and total_days of zero, which is the honest exclusive elapsed time on day one.

Input contract, the future-start rule, and the response shape

Optional output keys are omitted rather than set to null. POST a JSON object with two required calendar fields. sobriety_date is the first day of continuous sobriety as a strict four-digit year, hyphen, two-digit month, hyphen, two-digit day string; aliases start_date, sober_since, and date_from are accepted so journals and forms can keep their usual names. current_date is the reference day used as today or as the day you want elapsed time reported; aliases as_of, as_of_date, today, and date_to map to the same parse. Each field is validated as a real Gregorian day in years one through nine thousand nine hundred ninety-nine, including leap-day rules, so values such as 31 April, 29 February in a common year, 13-01, empty strings, and non-strings fail with invalid_input naming the field. If sobriety_date falls after current_date the start is in the future relative to the reference day and the task fails with invalid_input; elapsed sobriety is undefined for a start that has not happened yet, and that failure is not billed. On success the body echoes the normalised sobriety_date and current_date strings, returns integer years, months, and days from the civil breakdown, reports total_days as the exclusive ordinal difference, and attaches elapsed, a printable phrase with correct singular and plural units such as '6 years, 6 months, 10 days' or '1 year, 0 months, 1 day'. Pair the numbers with your own copy if you want a chip inscription; this endpoint does the calendar arithmetic only and does not emit meeting scripts, medical advice, or a diagnosis of a substance-use disorder.

Where a sobriety elapsed-time API earns its keep, pricing, and honest limits

Recovery chips, anniversary cards, and sponsor check-ins are the usual job: you already know the start date and you want a stable years-months-days line you can read aloud or print without subtracting months by hand and getting February wrong. Wellness apps, recovery journals, and coaching bots can call the same contract instead of re-coding leap-year tables in every client, pinning current_date from the user's local calendar day so a traveller who crosses a date line still sees the day they meant. Prepaid API calls use KIT balance at $0.002 per successful item; validation failures never consume balance. This is a calendar heuristic, not a diagnostic medical device and not a substitute for a recovery programme, a clinician, or emergency care. It does not count hours, minutes, or seconds, does not model relapse windows, and does not decide whether a slip resets a personal clock: that policy belongs to the person and their programme. Do not confuse this endpoint with a generic date-difference tool that people search when they want any two dates subtracted: the search intent here is time sober from a sobriety start, and the error contract is the future-start rule that a general date subtractor would not advertise. Keep requests small, pin the returned years, months, days, and total_days in tests, and you get reproducible elapsed sobriety for homework checkers, LMS plugins, and edge workers without standing up a calendar library of your own.

Wellness apps and recovery journals

Embed elapsed sobriety in an app or journal via the API, passing current_date from the user's local day so leap years stay consistent.

How does the sobriety calculator count years, months, and days?

It parses sobriety_date and current_date as Gregorian YYYY-MM-DD values, takes the exclusive whole-day difference as total_days, then reports civil years, months, and leftover days using calendar-month addition with clamp on short months.

Why do I have to send current_date instead of using today automatically?

The engine never reads a wall clock or a time zone, so the free widget and the API stay identical. Supply the as-of calendar day you mean; aliases as_of, as_of_date, today, and date_to are accepted.

What does a sobriety calculation cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid dates and a future start are not billed.

Read the full KIT documentation →