Countdown Timer Widget
Add a live countdown to a launch, sale, exam or event on your website. Set the date, time and time zone once and every visitor counts down to the same moment.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/countdown-timer" title="Countdown Timer by A2Z Tools" width="100%" height="250" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="countdown-timer" data-height="250"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
You give the countdown a target date and time and, ideally, the IANA time zone it is written in (for example Asia/Kolkata). The widget converts that wall-clock time to one exact instant, so a visitor in New York and one in Dubai see the same number of hours left. On every tick it subtracts the current time from that instant and splits the rest into days, hours, minutes and seconds, so it never drifts even if the tab was asleep. When the moment passes, the tiles are replaced by your "started" message. Two daylight-saving edge cases are handled in the open: a time that falls in a spring-forward gap (01:30 in London on 28 March 2027 never happens) is moved to the moment clocks jump, and a time that happens twice on the autumn night clocks go back is read as the first occurrence; either way a note under the tiles says what was assumed. Remaining seconds are rounded up, so the display reaches 0 exactly at the target instead of a second early. Under the tiles the widget prints the target in the event's own zone and, when it differs, in the visitor's zone, which answers the question most readers have: what time is that for me? For screen readers the tiles carry one text label ("91 days, 6 hours, 29 minutes left") that changes once a minute, and the ticking digits are hidden, so nothing is read out every second.
Method
- Target instant = the wall-clock time in the chosen IANA zone converted to UTC (or an explicit Z / +05:30 offset)
- Remaining seconds = ceiling((target - now) / 1000), recomputed from the device clock on every tick
- Days = floor(s / 86400); hours = floor(s mod 86400 / 3600); minutes = floor(s mod 3600 / 60); seconds = s mod 60
- Without a zone or offset the time is read in each visitor's own zone (useful for "midnight wherever you are")
- Daylight-saving gap: the skipped time is moved forward by the jump; overlap: the first of the two instants is used; both are noted
- Refresh: checked 4 times a second, redrawn when the displayed second changes; paused while the frame is hidden
Worked examples
New Year's Eve in India, seen from anywhere
Inputs: v_target=2026-12-31T23:59, v_zone=Asia/Kolkata; visitor opens the page at 2026-10-01 12:00 UTC
Result: 91 days, 6 hours, 29 minutes, 0 seconds
23:59 IST is 18:29 UTC. From 12:00 UTC that is 7,885,740 seconds: 91 x 86,400 + 6 x 3,600 + 29 x 60.
A Diwali sale ending in IST
Inputs: v_target=2026-11-08T23:59, v_zone=Asia/Kolkata; visitor opens the page at 2026-10-01 06:30 UTC
Result: 38 days, 11 hours, 59 minutes, 0 seconds
The end instant is 2026-11-08 18:29 UTC for every visitor, whatever their own zone.
A target inside the spring-forward gap
Inputs: v_target=2027-03-28T01:30, v_zone=Europe/London
Result: Counts down to 2027-03-28 01:30 UTC (02:30 BST) with a note that 01:30 is skipped
UK clocks jump from 01:00 GMT to 02:00 BST that morning, so 01:30 local never exists; the widget moves it forward by the one-hour jump.
Limitations
- It trusts the visitor's device clock: a phone set five minutes fast reaches zero five minutes early.
- One fixed target only - no repeating countdowns such as "every Friday at 18:00" and no list of several events.
- The largest unit is days; months and years are not shown because their length varies.
- Leap seconds are ignored, as in all computer clocks that follow POSIX time.
- Target years before 1000 are refused, and a target in the past shows the finished message straight away.
Where publishers use it
- A product or app launch page counting down to release time in the company's home time zone
- Wedding, festival and conference sites showing how long is left until the day
- Schools and coaching sites counting down to an exam or admission deadline
- Webinar landing pages where attendees in different countries need the same start moment
Questions
Why should I set a time zone?
Without one, "2026-12-31T20:00" means 8 pm in each visitor's own zone, so people in different countries reach zero at different moments. With v_zone=Europe/London (or any IANA name) everyone counts down to the same instant.
What happens when the countdown reaches zero?
The tiles are replaced by a message. By default it reads "<label> has started."; set your own text with v_done.
Does it keep time if the page stays open for days?
Yes. It recalculates from the device clock on every tick instead of counting down a stored number, and it pauses while the page is hidden, so it cannot drift.
Can I use an exact UTC time?
Yes. Write the target with a Z or an offset, for example 2026-12-31T18:30Z or 2027-01-01T00:00+05:30.
Sources
- Time Zone Database (tz / zoneinfo) - IANA . UTC offsets and daylight-saving transitions used to turn the target wall-clock time into one instant
- ISO 8601 date and time format - ISO . The YYYY-MM-DDTHH:MM target syntax and the Z / +hh:mm offset suffixes
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Countdown Timer https://a2z.tools/embed/countdown-timer
<a href="https://a2z.tools/embed/countdown-timer">A2Z Tools Countdown Timer</a>
[A2Z Tools Countdown Timer](https://a2z.tools/embed/countdown-timer)
Countdown Timer by A2Z Tools - https://a2z.tools/embed/countdown-timer
Related widgets
-
A slim banner with your offer headline, a live countdown and an optional Shop now button.
-
Live local time, date and UTC offset for up to 12 cities you choose.
-
Years, months and days between two dates or date-times, plus totals in days, weeks and hours.
-
A keyboard-friendly month calendar with today highlighted and your own marked dates.
-
Exact age in years, months and days, totals in months, weeks and days, and the next birthday.
-
Convert a date and time between any two time zones, with daylight-saving gaps and overlaps explained.