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 |
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.
- 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.
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.
- 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 |
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 durations. They do not add or subtract times of day, handle time zones or daylight saving changes, or work out breaks.
- 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.
- They support positive durations only.
- 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.