Days are not always a fine enough unit. When the target is a launch, a deadline or the last minute of the year, a countdown has to keep running in hours, minutes and seconds.
To count down hours, minutes and seconds, start with the seconds and work upward, borrowing 60 seconds from the minutes and 60 minutes from an hour when a unit runs out. If the timer crosses a day, take 24 hours from the day count you calculated earlier and reduce the days by one. At zero seconds, drop the minutes by one and restart at 60 seconds; at zero minutes, drop the hours by one and restart at 60 minutes.
How do you count down hours, minutes, and seconds?
The calculation for the smaller scales follows the same subtraction as a date countdown, but you begin with the seconds and proceed upward. Whenever a unit is exhausted, borrow from the next larger unit: 60 seconds from the minutes, then 60 minutes from one hour. If the countdown crosses a day boundary, take 24 hours from the day portion you calculated before and reduce that day count by one.
The countdown calculator uses fixed time constants for each unit and truncates each result downward:
| Unit | Value used by the calculator |
|---|---|
| Minute | 60,000 ms |
| Hour | 3,600,000 ms |
| Day | 24 hours |
| Year | 365.25 days |
How do you borrow units in a countdown timer?
Counting down hours, minutes and seconds differs from counting days in one respect: the smaller units flow fast. Start the timer from the seconds, and be quick about it. Once the seconds reach 0, decrease the minutes by one and start again with 60 seconds. Perform that switch instantaneously, because 0 and 60 share the exact same moment in time. When the minutes reach 0, decrease the hours by one and start again with a 60-minute buffer.
Worked example: the last minute of a countdown
Take a timer showing one minute still to run. Its seconds start at 60 and decrease one by one. When the seconds display reaches 0, the minutes drop by one and the seconds immediately restart at 60 — the moment of 0 seconds and the moment of 60 seconds are the same instant, so the countdown never pauses. From there the seconds run down again until the timer finally reaches zero and the target moment arrives.
Frequently Asked Questions
What happens when the seconds reach zero?
You decrease the minutes by one and restart the seconds at 60. The change is instantaneous: the 0 of one minute and the 60 of the next share exactly the same moment in time.
How do you handle a countdown that crosses a day?
Take 24 hours from the day count you calculated for the date countdown, and reduce the number of days by one before continuing with the hours, minutes and seconds.
What values does the calculator use for a day and a year?
The calculator defines a day as 24 hours and a year as 365.25 days. Its minutes and hours are 60,000 ms and 3,600,000 ms respectively.
Why do you start a countdown timer with the seconds?
Because the seconds change fastest. The source method starts with the seconds and works upward, borrowing from minutes and hours as each smaller unit runs out.
References
- Omni's Countdown Calculator source content: "Smaller scales countdowns: timer countdown calculator".
- The calculator's built-in time constants: 60,000 ms per minute, 3,600,000 ms per hour, 24 hours per day and 365.25 days per year.
- The borrow rules for seconds, minutes and days stated in the same source.