Calculate countdown

Measure the signed elapsed-millisecond interval between the browser clock and a target instant.

freeworks offlinenothing uploaded
ToolCountdown Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The parsed target minus Date.now determines past or future, and its absolute value is divided into fixed 86,400-second days plus remainder hours, minutes, and seconds. The target is normalized to an ISO UTC timestamp while incomplete display seconds are floored.

  • No target is assumed because an arbitrary countdown instant would be misleading.
  • The result is a calculation snapshot and changes only when the page reruns it.

Worked example

New Year Countdown
Calculate time remaining until New Year 2026
Input
											2026-01-01T00:00:00Z
										
Output
												236d 12h 45m 16s ago

The date 2026-01-01T00:00:00.000Z has already passed.

Days: 236
Hours: 5676
Minutes: 340605
Seconds: 20436316
											

When to use this

Release pages count toward UTC deadlines, incident reviews measure time since log timestamps, and event checklists compare the current clock with registration cutoffs.

Edge cases

  • An offset-free date-time is local to the browser, so different zones can interpret it as different instants.
  • A daylight-saving civil day is still decomposed as 86,400 elapsed seconds rather than 23 or 25 local hours.
  • Milliseconds remain exact in the signed total even though displayed seconds discard the fractional remainder.

References