Calculate countdown to a target date in days, hours and minutes
Find how long remains until a date: from 25 July 2026, 10:15 UTC, to 28 July 2026, 12:45 UTC, is 3 days, 2 hours and 30 minutes, or 4470 minutes. You enter the starting moment, so no clock skews it. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Current
- 2026-07-25T10:15:00Z
- Target
- 2026-07-28T12:45:00Z
- Days
- 3
- Hours
- 2
- Minutes
- 30
- Total minutes
- 4,470
Calculate a countdown to a target date without relying on the computer's clock. Supply both the current date and time and the future target as ISO-8601 values, and receive a stable breakdown of full days, remaining hours, and remaining minutes. Explicit inputs make the same request reproducible in tests, scheduled jobs, browser tools, and server workflows. Timezone offsets are normalized before subtraction.
Provide an explicit current time and target time
Start with two required strings: current and target. Each accepts a calendar date in YYYY-MM-DD form or an ISO-8601 date and time. A date without a clock is interpreted as midnight UTC, which is useful for day-level milestones.
For precise deadlines, include hours and minutes and preferably a trailing Z or a numeric offset such as +02:00. The calculator converts both inputs to a common absolute timeline before subtracting them, so two strings describing the same instant produce a zero countdown even when their displayed local hours differ. Supplying current rather than asking the service to read its wall clock is intentional.
The engine validates Gregorian month lengths and leap years instead of allowing impossible dates to roll into another month. It also rejects malformed times, invalid offsets, missing fields, and non-string values with an invalid-input response. Fractional seconds are accepted, but output is intentionally expressed only to whole minutes.
Seconds below a complete minute are discarded from the reported total, giving stable countdown digits rather than an unexpected rounded increase.
Read the countdown and handle overdue targets safely
Safety around overdue dates is stricter. When target represents an instant before current, the normal request fails and explains that elapsed must be enabled. This default prevents a negative interval from being converted silently into a positive-looking countdown.
If your workflow genuinely needs to report how long ago a deadline passed, send elapsed as true. A target exactly equal to current is valid and returns all zero duration fields.
Use deterministic results in applications and automation
This capability fits launch pages, registration deadlines, event preparation, maintenance windows, payment reminders, and any workflow that already knows the instant considered current. Numeric timezone offsets are applied directly, while daylight-saving interpretation remains the caller's responsibility; send the correct offset for each local instant rather than a city name. The calculation measures ordinary elapsed time in fixed twenty-four-hour days.
It does not count business days, skip weekends, load holiday calendars, schedule notifications, or update continuously after the response. Refreshing a live display means supplying a newer current value in another calculation. Validate errors separately in client code so a malformed date or unapproved past target is shown as a correction request rather than as a zero countdown.
What you can do with it
Launch countdown
Turn a known current instant and product release deadline into normalized countdown digits for a launch page.
Deadline monitoring
Check time remaining before registration or payment closes, while treating unexpectedly overdue targets as errors.
Elapsed milestone reporting
Enable elapsed mode to report complete days, hours, and minutes since a known event occurred.
FAQ
Does the calculator use the current system time?
No. You must provide current explicitly, making every calculation deterministic and reproducible.
What happens when the target is in the past?
With elapsed enabled, the response reports time since the target and marks direction as elapsed.
Are timezone offsets supported?
Yes. Use Z or a numeric offset such as +02:00. Both inputs are normalized to the same absolute timeline before subtraction.
How are seconds handled?
Seconds may be supplied, but the result reports complete minutes. Any partial final minute is discarded rather than rounded up.
Does the countdown skip weekends and holidays?
No. It measures plain elapsed time in fixed 24-hour days, so weekends and public holidays count like any other day. Business days need a different calculation.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/countdown-to-date \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"current":"2026-07-25T10:15:00Z","target":"2026-07-28T12:45:00Z"}'const res = await fetch("https://api.kit.forhosting.com/math/countdown-to-date", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"current": "2026-07-25T10:15:00Z",
"target": "2026-07-28T12:45:00Z"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/countdown-to-date",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"current": "2026-07-25T10:15:00Z",
"target": "2026-07-28T12:45:00Z"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/countdown-to-date", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"current":"2026-07-25T10:15:00Z","target":"2026-07-28T12:45:00Z"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"current":"2026-07-25T10:15:00Z","target":"2026-07-28T12:45:00Z"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/countdown-to-date", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"current": "2026-07-25T10:15:00Z",
"target": "2026-07-28T12:45:00Z"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.countdown_to_date",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
If the target has already passed, the request returns an error unless elapsed mode is deliberately enabled, preventing an overdue deadline from being mistaken for time remaining.
Provide an explicit current time and target time
It makes saved examples, automated tests, invoice runs, and repeated API calls deterministic.
Read the countdown and handle overdue targets safely
A successful future countdown returns days, hours, minutes, total_minutes, direction, and is_past. The three display fields form a conventional normalized duration: hours is always between zero and twenty-three, and minutes is always between zero and fifty-nine. total_minutes is the full absolute count of complete minutes and is convenient for sorting records, comparing thresholds, or deciding when to change a user interface. For a future or exactly matching target, direction is remaining and is_past is false. The result then uses the same non-negative duration fields, direction becomes elapsed, and is_past becomes true. This explicit switch makes downstream wording straightforward: display “remaining” for an active deadline and “elapsed” or “overdue” for a completed one, without guessing from the numbers themselves.
Use deterministic results in applications and automation
A client can map days, hours, and minutes directly into countdown cards, while retaining total_minutes for alert rules and ordering. Because the implementation never reads Date, the wall clock, a timezone database, the network, or random state, identical JSON always produces identical output. That property is valuable when a queue retries work or when a historical report must be regenerated later. The browser version can perform the same pure operation locally, while API automation costs $0.002 per item.
Technical questions
What does an API calculation cost?
Each successful API item costs $0.002. The in-browser calculator can run the same deterministic logic locally.