How elapsed time is calculated
The calculator subtracts the earlier date-time from the later date-time. Because months have different lengths (28–31 days), the years and months component is calculated using calendar arithmetic: months are counted by stepping through the calendar, and any remaining partial month is broken down into days. The remaining time within the final day is expressed as hours, minutes, and seconds.
The result is also expressed as a single total in each unit independently — total days, total hours, total minutes, and total seconds — so that the duration can be used directly in formulas. Total seconds is the most precise representation and is calculated as the raw difference between the two Unix timestamps (seconds since 1 January 1970 UTC).
Total seconds = End timestamp (s) − Start timestamp (s)
The most precise form; all other units are derived from this.
Total minutes = Total seconds ÷ 60
Truncate to get whole minutes; the remainder is remaining seconds.
Total hours = Total minutes ÷ 60
Truncate to get whole hours; the remainder is remaining minutes.
Total days = Total hours ÷ 24
Truncate to get whole days; the remainder is remaining hours.