Countdown Calculator
Enter a target time to see exactly how many days, hours, minutes and seconds remain — or how long has passed.
An exam, a deadline, the end of the year, a release date — "how long is left?" is worth answering precisely: the target time goes in and the remaining days, hours, minutes and seconds come back broken down, while a moment already past reports how long ago it was. Unlike a running countdown clock, this is a static difference between two instants, which is what belongs in a notice, a poster or a schedule.
The useful detail is the reference time: instead of "now" you can enter a fixed current time yourself, so the same target gives the same result tomorrow and the day after — a screenshot shared with a group will not disagree with everyone else's simply because it was taken at a different moment. For a target in another time zone, such as an overseas release, convert it to local time first.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Enter the target date and time.
- Optionally replace "now" with a fixed reference time so the result is reproducible.
- Read the remaining days, hours, minutes and seconds — or how long ago the moment passed.
- Copy the result; convert any other time zone to local time before entering it.
How it works
How to enter the target time
The target time format is YYYY-MM-DD HH:mm:ss; the time part is optional (defaults to 00:00:00).
Setting the base time
Leave "current time" blank to compute from the live time when the page opens; click "fill current time" to fix a base point so results are reproducible and screenshot-ready.
Reading the result
The result gives the four components days/hours/minutes/seconds plus total seconds; when the target has passed, the label becomes "elapsed."
Code example
JavaScript Splitting a millisecond difference into d/h/m/s
function countdown(target, now = Date.now()) {
let ms = Math.abs(new Date(target) - now);
const d = Math.floor(ms / 86400000); ms -= d * 86400000;
const h = Math.floor(ms / 3600000); ms -= h * 3600000;
const m = Math.floor(ms / 60000); ms -= m * 60000;
const s = Math.floor(ms / 1000);
return { d, h, m, s };
}
countdown("2027-01-01T00:00:00"); // time until New Year
Python timedelta splits it for you
from datetime import datetime
delta = datetime(2027, 1, 1) - datetime.now()
delta.days, delta.seconds # days, seconds within the day
# Hours and minutes come from splitting seconds further:
h, rem = divmod(delta.seconds, 3600)
m, s = divmod(rem, 60)
FAQ
How does this differ from the date calculator?
The date calculator gives the number of whole days between two dates; this counts down to an exact hour/minute/second. Use this for exams, flash sales and other second-precision scenarios.
Does it auto-refresh?
No. With "current time" blank, it uses the time at page load; clicking calculate recomputes from that click's live time. For a moving countdown, fix the base point to observe the difference.
What's the maximum time span?
100 years; beyond that it warns "span exceeds 100 years." Years accept 1-9999.
How does the countdown compute remaining days?
It subtracts the current time from the target to get a millisecond difference, converted into days, hours, minutes and seconds. When truncating days, mind whether the start day counts: "30 days left" in an exam countdown usually excludes the start day.
How do I count down to New Year or Spring Festival?
For New Year, set the target to that year's Dec 31 24:00 (i.e. Jan 1 00:00 next year); Spring Festival is a lunar holiday whose Gregorian date varies yearly, so look up that year's date first. This tool computes by the exact date entered.
What is a countdown good for?
Common uses: exam and sign-up deadlines, project delivery dates, product launches and campaign go-lives, New Year and anniversaries, membership or discount expiry reminders. Breaking a big goal into "days remaining" makes progress clearer.
Why don't the countdown numbers tick?
Live refresh relies on browser timers, and a backgrounded page lowers or pauses them to save power, resuming only when foregrounded. Fill in a fixed "current time" for a reproducible result, or refresh the page to re-fetch the current time.