← All how-to recipes

How to calculate seconds between two times

✓ Verified in LibreOffice 25.8.7.3

Precise durations for logs, laps, and processing times.

The formula

AppFormulaNotes
Excel=(B2-A2)*8640086,400 = seconds per day. Format the result as a Number.
Google Sheets=(B2-A2)*86400Identical.
LibreOffice Calc=(B2-A2)*86400Identical.

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. Every formula here is confirmed by actually executing it.