Create a live local-time countdown to an event or measure exact time elapsed since a past date and time.
The target date and optional HH:MM time become a local browser timestamp. Each live tick subtracts the current timestamp from that target, then decomposes the absolute duration into fixed 24-hour days, hours, minutes, and seconds.
The timer recomputes from the current clock every second rather than decrementing stored state.
duration = |target instant − current instant|This separate date-only result uses actual calendar boundaries and is not the same as fixed 24-hour duration.
calendar difference = complete years + complete months + remaining daysAugust 13, 2026 at 12:00 to August 14 at 12:00 is exactly 1 day.
12:00 to 13:30 on the same date is 1 hour 30 minutes.
A target exactly 24 hours in the past displays 1 day elapsed.
When target time is blank, the target is 00:00:00 at the beginning of the selected date.
The browser's local timezone and daylight-saving rules determine the target instant.
Delayed timer callbacks do not accumulate error because every tick reads Date.now() again.
Calendar difference compares dates using real month and year boundaries. Exact duration compares instants and may differ because of time of day or daylight-saving transitions.
Past targets are accepted automatically and labeled as elapsed time rather than producing negative countdown digits.
Midnight, 00:00:00 local time, at the beginning of the target date.
Yes. Past targets automatically display time elapsed.
Each tick recomputes from Date.now(), so delayed callbacks do not cause cumulative drift.
Version 1 uses your browser's local timezone. Named timezone selection is not included.
It switches to Countdown complete and clamps every displayed unit to zero.
No. Calendar difference uses calendar units, while exact duration uses fixed elapsed milliseconds.