Time Duration Calculator
Computes the elapsed time between two clock times entered as start and end hours and minutes on a 24-hour clock, using minutes-since-midnight subtraction: end minutes minus start minutes, with 1,440 minutes added when the result is negative so overnight shifts roll to the next day. Returns the duration as hours and minutes, as decimal hours rounded to two places for payroll, and as total minutes.
Enter the start and end of a period as hours and minutes on a 24-hour clock, and the calculator returns the length three ways: as hours-and-minutes, as decimal hours, and as a plain minute count. It updates as you type. When the end time is earlier than the start, the period is treated as crossing midnight and a full day is added, so a shift from 22:00 to 06:00 reads as eight hours rather than a negative number.
How the duration is calculated
Both times are turned into minutes since midnight, and the start is subtracted from the end:
minutes = (h2 × 60 + m2) − (h1 × 60 + m1)
If that comes out negative, 1,440 minutes — one day — are added. The default inputs run 9:15 to 17:40. The start is 9 × 60 + 15 = 555 minutes; the end is 17 × 60 + 40 = 1,060. Subtracting gives 1,060 − 555 = 505 minutes, which is 8 hours 25 minutes, or 8.42 decimal hours. That single figure of 505 sits behind all three results.
Decimal hours for timesheets
Payroll systems rarely accept "8 hours 25 minutes". They want decimal hours, because decimal hours multiply straight against an hourly rate. The conversion is minutes ÷ 60, so 25 minutes is 25 ÷ 60 = 0.42 of an hour and the 505-minute example becomes 8.42. The quarter-hour marks are the ones worth committing to memory.
| Minutes | Decimal hours |
|---|---|
| 15 | 0.25 |
| 25 | 0.42 |
| 30 | 0.50 |
| 40 | 0.67 |
| 45 | 0.75 |
Decimal hours are not minutes with a decimal point dropped in: 8.42 hours is 8 hours 25 minutes, not 8 hours 42 minutes. Rounding to two places is fine for a single rate calculation, but the leftover fractions can drift by a cent or two across a long pay period, which is why many employers round each shift before totalling. The US Department of Labor rule at 29 CFR 785.48 allows start and stop times to be recorded to the nearest five minutes, tenth of an hour or quarter hour, so long as the rounding averages out and does not leave the worker short over time.
Why a day holds 24 hours
The count of 24 is older than any clock. The ancient Egyptians split daylight and darkness into twelve parts each, reading the night by the rising of 36 star groups now called decans; over the course of a night about twelve of them climbed into view, and that tally fixed the number of night hours. By the New Kingdom, which opened around 1550 BC, the working set of reference stars had been reduced to 24, twelve of them marking the passage of any one night. These were not the even hours a wristwatch keeps. Because daylight was always divided into twelve regardless of season, a daytime hour in midsummer ran far longer than one in midwinter. Such temporal, or seasonal, hours stayed standard through the Greek, Roman and most of the medieval European world, and a Roman sundial hour simply stretched and shrank across the year.
The base-60 habit behind minutes and seconds
The subdivisions come from a different source. Sumerian and Babylonian mathematicians counted in base 60, a system in use in Mesopotamia by the third millennium BC. Sixty is convenient because it divides evenly by 1, 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30, so fractions of it rarely leave a remainder. In the second century CE the astronomer Ptolemy carried that base into both angle and time, taking the 360-degree circle he had inherited from Babylonian practice and cutting each degree into sixty parts and each of those into sixty again, and he named them in Greek as the first and second sixtieths. When his Almagest passed into Arabic in 827 and then into Latin in 1175, those became pars minuta prima, the first small part, and pars minuta secunda, the second small part. English kept the first as minute and, because the obvious word was already taken, called the next one second. The labels on a stopwatch are a direct inheritance from a Greek treatise on planetary motion.
From seasonal hours to the clock on the wall
Equal hours — the 24 identical slices a modern clock keeps — were used by Greek astronomers for calculation long before anyone lived by them. Hipparchus, working in the second century BC, proposed dividing the day into 24 equinoctial hours, taking the even twelve-and-twelve split that holds only at the equinoxes and applying it all year round. They entered daily life with the mechanical clocks that spread across Europe in the 14th century, for a plain mechanical reason: a gear train ticks at a constant rate, and forcing it to follow elastic seasonal hours was more trouble than teaching the public to read even ones. Early clocks still disagreed on where to begin the count. Italian hours started at sunset, Babylonian hours at sunrise, astronomical hours at midday, and what were called great-clock hours at midnight — the midnight start that eventually prevailed.
Running the count all the way to 24 rather than twice to 12 was pushed along by transport and the military. The Canadian Pacific Railway adopted the 24-hour clock in 1886, and Italy became the first country to take it up nationally in 1893. The French Army followed in 1909, the British Royal Navy in 1915, the US Navy in 1920 and the US Army in 1942. The pressure to agree on the time at all had come a little earlier from the railways: Britain's Great Western Railway ran on a single railway time from 1840, and by 1855 an estimated 98 per cent of the public clocks in Britain were set to Greenwich Mean Time.
Paying people by the clocked hour is younger still. On 20 November 1888, Willard Le Grand Bundy, a jeweller in Auburn, New York, was granted US patent 393,205 for a time recorder worked by a key. Each employee carried his or her own numbered key, and turning it in the machine printed that number and the time onto a paper strip wound on a spool inside the case. He and his brother Harlow set up the Bundy Manufacturing Company in Binghamton, New York the following year, and the time clock spread quickly through American workplaces; the firm was rolled into the Computing-Tabulating-Recording Company in 1911, which was renamed IBM in 1924. Once a shift was recorded to the minute, someone had to turn those minutes into money, which is exactly the decimal-hour arithmetic this tool automates.
Overnight shifts and reading the 24-hour clock
The roll-over rule is what makes night shifts work. A shift clocking in at 22:00 and out at 06:00 gives 360 − 1,320 = −960 minutes; adding a day yields 480 minutes, or exactly 8 hours. The calculator cannot tell a genuine overnight shift from a mistyped entry, so it assumes any end-before-start pair means the next day. A single entry also caps just under 24 hours — for anything longer, reach for a date-based tool.
US readers are the ones most likely to trip on the input format. Everyday American scheduling uses 12-hour AM/PM time, so 5:40 in the afternoon has to be entered as hour 17, not 5. Most of continental Europe writes 24-hour time routinely, while British speech stays on 12-hour time even though printed timetables run to 24. The 24-hour format is also standard for transport schedules, hospitals and the military in the US, Canada and Australia. When in doubt, add 12 to any afternoon or evening hour: 1 PM is 13, 9 PM is 21, and midnight is 0.
Frequently asked questions
How do I convert minutes to decimal hours for payroll?
Divide the minutes by 60. So 25 minutes is 25 ÷ 60 = 0.42 hours, and a shift of 8 hours 25 minutes is entered on a timesheet as 8.42. The quarter-hour values are the ones worth learning: 15 minutes is 0.25, 30 is 0.50 and 45 is 0.75.
How do I calculate hours for an overnight shift?
Enter the clock-in and clock-out times as usual and let the end time fall before the start. This calculator adds a full day automatically, so 22:00 to 06:00 comes out as 8 hours rather than a negative figure. It works for any shift shorter than 24 hours.
What is 8 hours and 25 minutes in decimal?
It is 8.42 hours. The 8 whole hours stay as they are, and the 25 minutes become 25 ÷ 60 = 0.4167, which rounds to 0.42. This is not the same as 8.25, which would be 8 hours 15 minutes.
How do I enter afternoon times on a 24-hour clock?
Add 12 to the 12-hour figure for any time from 1 PM onward. So 5:40 PM becomes hour 17 and minute 40, and 9 PM becomes hour 21. Times before noon read the same in both systems, and midnight is hour 0.