How to calculate seconds between two times
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Precise durations for logs, laps, and processing times.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =(B2-A2)*86400 | 86,400 = seconds per day. Format the result as a Number. |
| Google Sheets | =(B2-A2)*86400 | Identical. |
| LibreOffice Calc | =(B2-A2)*86400 | Identical. |
How it works
Times are day-fractions, so a difference times 86,400 (24×60×60) yields seconds: 9:00:00 to 9:02:05 is 125 seconds. The same subtraction scales to any unit — ×1440 for minutes, ×24 for hours. For same-day times that might cross midnight wrap in MOD(B2-A2,1) first; sub-second precision survives if the source data carries it (spreadsheets store milliseconds fine, they just don't display them by default — format ss.000).
Verified, not just documented
We ran =(TIME(9,2,5)-TIME(9,0,0))*86400 in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 125 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 125 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.