This page states exactly how Decimal to Time reads input, converts it, rounds it and totals it. If a result ever disagrees with this page, that is a bug: please report it.
Units and notation
Each converter tells you which notation it expects. The tools never guess between them.
| Notation | Meaning | Example |
|---|---|---|
| Decimal hours | Hours with a fractional part. The digits after the point are tenths, hundredths and so on of an hour. | 7.75 is 7 hours 45 minutes |
| H:MM or H:MM:SS | Hours, then minutes (00 to 59), then optional seconds (00 to 59). Hours can go past 24, because these are durations. | 37:30 is 37 hours 30 minutes |
| Minutes | A total number of minutes, which may have a decimal part. | 465 is 7 hours 45 minutes |
| Military time (HHMM) | A time of day on the 24-hour clock: two digits for the hour (00 to 23) and two for the minutes (00 to 59), with two more for seconds if you need them. 2400 is accepted as the end of the day. | 1730 is 17.50 hours |
The two notations look alike and mean different things. 7.30 hours is 7 hours 18 minutes (0.30 × 60 = 18), while 7:30 is 7 hours 30 minutes, or 7.5 hours.
Exact arithmetic
Every value is converted to a whole number of microseconds and kept that way. One hour is 3,600,000,000 microseconds. Decimal input is read digit by digit, never as a floating-point number, so 7.75 hours is exactly 27,900,000,000 microseconds. Inputs with up to six decimal places are exact in every unit. Longer ones are rounded to the nearest microsecond, which is far below anything the tools display.
Nothing is rounded along the way. Rounding happens once, when a result is displayed.
Display and rounding
- Decimal to time. The result shows seconds whenever the value is not a whole number of minutes. The option "Round to the nearest minute" rounds half up (30 seconds rounds up) to hours and minutes, and the exact value stays visible under the result.
- Time to decimal and minutes to decimal. The result is rounded half up to the number of decimal places you choose, from 0 to 6, with 2 as the default. When the value is rounded, the result is marked as rounded and the more precise value is shown next to it.
- Military time. Military time to decimal rounds half up to the number of decimal places you choose, like time to decimal. Decimal to military time rounds half up to the nearest minute, because military time has no seconds here; the result is marked as rounded and the exact time is shown next to it.
- Totals. Totals add the exact values first and are rounded once (see the next section).
Rounded displays hide information. A source system that rounded some longer value to 0.33 hours has lost the original value, and no tool can recover it. Converting 0.33 hours exactly gives 19 minutes 48 seconds.
Totals in the batch converter
The total is the sum of the exact values of all valid rows, formatted once. Adding the converted cells by hand can give a different answer, because every cell was rounded separately. When the two differ, the page shows the sum of the cells as displayed, the true total and the difference.
Rows with errors are not included in the total. The page states how many rows were left out. Blank lines stay in place in the output so it lines up with your source, and they are not counted as zeros.
For decimal to time, the whole column uses one clock format: H:MM when every converted row is a whole number of minutes, H:MM:SS otherwise, unless you choose a format yourself.
Totals in the Decimal Hours Calculator
The Decimal Hours Calculator adds and subtracts durations. Each line has a sign (+ or −), a format (decimal hours, H:MM or minutes) and a value. Every value is read with the same strict rules as the single converters, converted to an exact number of microseconds, and added to or taken from the running total. Nothing is rounded until the total is displayed.
- The total is shown in decimal hours, rounded half up to the number of places you choose (0 to 6, with 2 as the default), and as a clock time: H:MM when the total is a whole number of minutes, H:MM:SS otherwise.
- A negative value typed into a line is flagged. To subtract, use the − sign on that line.
- Blank lines are ignored and are not treated as zeros. Lines with errors stay visible and are left out of the total, and the page states how many were left out.
- If you subtract more than you add, the total is negative. It is shown with a minus sign and a short note, not as an error.
Tenths of an hour
Some billing systems count time in tenths of an hour. One tenth is exactly 6 minutes (0.1 hour), so minutes divided by 6 gives tenths. Two rounding conventions are in use, and the Tenths of an Hour Chart shows both:
- Round up. Any started 6-minute block counts as a full tenth. 1 to 6 minutes is 0.1 hour, 7 to 12 minutes is 0.2 hour, and 0 minutes stays 0.0.
- Nearest tenth. The duration is rounded half up to the nearest tenth. 0 to 2 minutes is 0.0 hour, 3 to 8 minutes is 0.1 hour, and 57 to 60 minutes is 1.0 hour.
Both rules round the exact value once. The tools do not choose a rule for you: your contract, client or payer decides which one applies.
Military time to decimal
The Military Time to Decimal converter reads a time of day written on the 24-hour clock and converts it to decimal hours, or turns decimal hours back into military time.
- Accepted forms. Four digits (1730), six digits with seconds (173045), or H:MM, HH:MM and HH:MM:SS (17:30). The hour runs from 00 to 23, and 2400 or 24:00 is accepted for the end of the day (24.00 hours). Anything later is flagged.
- 12-hour times. A time with AM or PM (5:30 PM) is flagged, and the 24-hour spelling (1730) is offered to click. The converter never guesses between AM and PM on its own.
- Missing zero. Three digits such as 930 are flagged, and 0930 is offered to click.
- Decimal to military. Decimal hours from 0 to 24 are converted and rounded half up to the nearest whole minute. A value above 24 hours is flagged and points to the Decimal to Time converter.
- Two decimal places are enough to come back. Rounding to two decimal places moves a time by at most 18 seconds (half of 0.01 hour, which is 36 seconds), so converting a two-place value back to the nearest minute returns the same military time.
Military time is a time of day: it says where a moment sits in the day, not how long a shift lasted. To find a length, convert both times and subtract, adding 24 to an end time that falls after midnight. The Decimal Hours Calculator can do the subtraction.
Accepted input
- Decimals use a period. A comma is flagged, and where the meaning is clear the tool offers the corrected value to click, such as 7.5 for 7,5.
- Thousands separators, scientific notation (1e3), units or letters, and negative values are flagged, not converted.
- Leading and trailing spaces, non-breaking spaces and full-width digits are normalized before reading.
- Blank input is never treated as 0. In the hours, minutes and seconds fields, a blank field counts as 0 once at least one other field has a value.
- Minutes and seconds must be from 00 to 59. A value such as 1:75 is flagged, with the corrected 2:15 offered to click.
- Military time is four digits, six with seconds, or written with a colon. 12-hour times (5:30 PM), the wrong number of digits, an hour past 24 and minutes over 59 are flagged, and the corrected spelling is offered when it is unambiguous. Four digits typed into the H:MM calculator, such as 1730, are flagged and the military converter is named.
- A pasted row with more than one column (a tab) is flagged.
Errors
Unsupported input always produces a message that says what is wrong. The tools do not silently correct input into a different number. Where a fix is obvious, it is offered as a button and applied only when you click it.
Limits
| Limit | Value |
|---|---|
| Length of one input | 40 characters |
| Digits before the decimal point | 7, so values up to 9,999,999 |
| Decimal places in the input | 15 |
| Rows per batch run | 500 |
| Characters per batch run | 20,000 |
| Lines per calculator run | 100 |
Inputs over a limit get a message explaining the limit. They do not crash the page or get cut off.
What the tools do not do
- They convert and total durations. The Military Time converter also reads a single time of day written on the 24-hour clock, but nothing here works out the time between a start and an end, handles time zones or daylight saving changes, or takes off breaks. The Decimal Hours Calculator only adds and subtracts the durations you type.
- They do not apply overtime, wage or rounding rules (such as rounding to the nearest quarter hour), and they do not calculate pay or tax. The tenths charts show two common conventions; they do not say which one applies to you.
- The converters take positive durations only. The Decimal Hours Calculator takes a positive value on each line and subtracts with the − sign.
- Nothing here is legal, financial or payroll advice. Whether a conversion is acceptable for your payroll or billing is for you, your employer or your adviser to decide.
Reference cases
These cases are calculated by the same code that powers the converters, and the automated tests check each one.
| Input | Result |
|---|---|
| 7.75 hours | 7 hours 45 minutes |
| 7.30 hours | 7 hours 18 minutes |
| 7:30 | 7.5 hours |
| 90 minutes | 1.5 hours |
| 0.01 hours | 36 seconds |
| 0.33 hours | 19 minutes 48 seconds |
| 37.5 hours | 37 hours 30 minutes |
| 24:00 | 24 hours (a duration, not a time of day) |
| 1:75 | Error: Minutes run from 00 to 59, so 1:75 is not a valid time. |
| blank input | No result. Blank is never treated as 0. |
| 60 rows of 1 minute | Total 1.00 hours exactly. Adding the rounded cells (0.02 each) would give 1.20. |
| 7.75 + 8.10 + 6.50 hours | Total 22:21 (22.35 h). |
Report a problem
If you find a case where the result disagrees with this page, send it through the contact page with the value you entered. It will be added to the tests.